- 打開(kāi) \app\common\dao\store\StoreCategoryDao.php文件, 找到
allChildren
? 方法 - 替換為一下內(nèi)容
public function allChildren($id)
{
$path = model::getDB()->where('store_category_id', is_array($id) ? 'IN' : '=', $id)->where('mer_id', 0)->column('path', 'store_category_id');
if (!count($path)) return [];
return model::getDB()->where(function ($query) use ($path) {
foreach ($path as $k => $v) {
$query->whereOr('path', 'LIKE', "$v$k/%");
}
})->where('mer_id', 0)->order('sort DESC')->column('store_category_id');
}
?
- 替換后重啟 swoole 服務(wù)即可