diff --git a/app/api/controller/Category.php b/app/api/controller/Category.php index 4b836ca3..e05111ad 100644 --- a/app/api/controller/Category.php +++ b/app/api/controller/Category.php @@ -50,7 +50,7 @@ class Category extends Controller $merchantId = (int)$this->request->param('merchantId', 0); $model = new CategoryModel; $hasGoods = GoodsCategoryRel::getcategory($this->storeId,$merchantId); - + print_r($hasGoods);die; $arr = []; if (!empty($arr)) { $arr = ['cataIds' => $hasGoods]; diff --git a/app/common/model/GoodsCategoryRel.php b/app/common/model/GoodsCategoryRel.php index 36d165bb..7cc52520 100644 --- a/app/common/model/GoodsCategoryRel.php +++ b/app/common/model/GoodsCategoryRel.php @@ -59,7 +59,7 @@ class GoodsCategoryRel extends BaseModel } $list = Goods::alias('a') ->rightjoin('goods_category_rel b', 'a.goods_id = b.goods_id') - ->where($where)->group('category_id') + ->field('category_id')->where($where)->group('category_id') ->select(); return $list; }