|
|
|
@ -20,6 +20,8 @@ use app\store\model\Merchant as MerchantModel; |
|
|
|
|
use app\store\model\Style as StyleModel; |
|
|
|
|
use app\common\model\Channel; |
|
|
|
|
use app\store\model\store\User as StoreUserModel; |
|
|
|
|
use app\common\model\MerchantGoodsCate; |
|
|
|
|
use app\api\model\Category; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 商户ID、商店ID 隔离商城里面的商户 |
|
|
|
@ -177,4 +179,18 @@ class Merchant extends Controller |
|
|
|
|
return $this->renderSuccess(compact('style')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getShopCategory(): Json{ |
|
|
|
|
$merchantId = $this->request->param('merchantId'); |
|
|
|
|
$merchant = new MerchantGoodsCate; |
|
|
|
|
$merchant = $merchant->where('merchant_id', $merchantId) |
|
|
|
|
->field('goods_cate') |
|
|
|
|
->find(); |
|
|
|
|
// $merchant = MerchantGoodsCate::detail($merchantId); |
|
|
|
|
$merchant = $merchant['goods_cate']; |
|
|
|
|
$goods_cate = explode(",", $merchant); |
|
|
|
|
$model = new Category; |
|
|
|
|
$list = $model->where('category_id', 'in', $goods_cate)->select(); |
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|