|
|
@ -47,11 +47,28 @@ class Category extends Controller |
|
|
|
|
|
|
|
|
|
|
|
public function listmerchant(): Json |
|
|
|
public function listmerchant(): Json |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$merchantId = $this->request->param('merchantId', ''); |
|
|
|
$model = new CategoryModel; |
|
|
|
$model = new CategoryModel; |
|
|
|
$hasGoods = GoodsCategoryRel::getcategory($this->storeId,6); |
|
|
|
$hasGoods = GoodsCategoryRel::getcategory($this->storeId,$merchantId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$arr = []; |
|
|
|
|
|
|
|
if (!empty($arr)) { |
|
|
|
|
|
|
|
$arr = ['cataIds' => $hasGoods]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$list = $model->getListPublic($this->request->param(), $arr); |
|
|
|
|
|
|
|
$tmplist = []; |
|
|
|
|
|
|
|
foreach ($list as $kl => $l) { |
|
|
|
|
|
|
|
$tmplist[$kl] = $this->listcata($list, $hasGoods); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->renderSuccess(compact('tmplist')); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function listcata($list, $hasGoods) { |
|
|
|
|
|
|
|
foreach ($list as $kl => $l) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$list = $model->getListPublic($this->request->param()); |
|
|
|
|
|
|
|
print_r($hasGoods);die; |
|
|
|
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|