正在显示
1 个修改的文件
包含
3 行增加
和
0 行删除
| @@ -31,6 +31,9 @@ class Category extends Base | @@ -31,6 +31,9 @@ class Category extends Base | ||
| 31 | */ | 31 | */ |
| 32 | public static function getChildIdsArr($id) | 32 | public static function getChildIdsArr($id) |
| 33 | { | 33 | { |
| 34 | + if(!$id){ | ||
| 35 | + return []; | ||
| 36 | + } | ||
| 34 | $list = self::where('status', self::STATUS_ACTIVE)->select(['id','pid'])->get()->toArray(); | 37 | $list = self::where('status', self::STATUS_ACTIVE)->select(['id','pid'])->get()->toArray(); |
| 35 | $ids = []; | 38 | $ids = []; |
| 36 | Arr::findChildIds($list, $id, $ids); | 39 | Arr::findChildIds($list, $id, $ids); |
-
请 注册 或 登录 后发表评论