作者 赵彬吉

update

@@ -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);