|
|
|
@ -55,6 +55,7 @@ class Category extends Controller |
|
|
|
|
|
|
|
|
|
public function listmerchant(): Json |
|
|
|
|
{ |
|
|
|
|
$list = []; |
|
|
|
|
$merchantId = (int)$this->request->param('merchantId', 0); |
|
|
|
|
$model = new CategoryModel; |
|
|
|
|
$hasGoods = GoodsCategoryRel::getcategory($this->storeId,$merchantId); |
|
|
|
@ -64,10 +65,14 @@ class Category extends Controller |
|
|
|
|
foreach ($hasGoods as $v) { |
|
|
|
|
$arr[] = $v['category_id']; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($arr)) { |
|
|
|
|
$arr1 = ['cataIds' => $arr]; |
|
|
|
|
} else { |
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$list = $model->getListPublic($this->request->param(), $arr1); |
|
|
|
|