diff --git a/app/api/controller/Category.php b/app/api/controller/Category.php index bb17a958..40f1ca1e 100644 --- a/app/api/controller/Category.php +++ b/app/api/controller/Category.php @@ -51,7 +51,7 @@ class Category extends Controller $model = new CategoryModel; $hasGoods = GoodsCategoryRel::getcategory($this->storeId,$merchantId); $arr = []; - if (!empty($hasGoods)) { + if (isset($hasGoods['data']) && !empty($hasGoods['data'])) { foreach ($hasGoods['data'] as $v) { $arr[] = $v['category_id']; }