diff --git a/app/api/controller/Merchant.php b/app/api/controller/Merchant.php index 9e05eb1d..190deea7 100644 --- a/app/api/controller/Merchant.php +++ b/app/api/controller/Merchant.php @@ -180,11 +180,15 @@ class Merchant extends Controller } public function getShopCategory(): Json{ + $list = []; $merchantId = $this->request->param('merchantId'); $merchant = new MerchantGoodsCate; $merchant = $merchant->where('merchant_id', $merchantId) ->field('goods_cate') ->find(); + if(empty($merchant)){ + return $this->renderSuccess(compact('list')); + } // $merchant = MerchantGoodsCate::detail($merchantId); $merchant = $merchant['goods_cate']; $goods_cate = explode(",", $merchant);