lszyh
zengyyh 10 months ago
parent e703c746ee
commit 5a0716ab8d
  1. 2
      app/api/controller/Category.php
  2. 2
      app/api/model/Category.php
  3. 11
      app/store/controller/Merchant.php
  4. 1
      config/allowapi.php

@ -85,4 +85,6 @@ class Category extends Controller
$list = $model->getListPublic($this->request->param(), $arr1); $list = $model->getListPublic($this->request->param(), $arr1);
return $this->renderSuccess(compact('list')); return $this->renderSuccess(compact('list'));
} }
} }

@ -44,4 +44,6 @@ class Category extends CategoryModel
$param = array_merge($param, $otherParam); $param = array_merge($param, $otherParam);
return parent::getList(array_merge($param, ['status' => 1])); return parent::getList(array_merge($param, ['status' => 1]));
} }
} }

@ -22,6 +22,7 @@ use app\store\model\store\User as StoreUserModel;
use app\store\model\store\Role as role; use app\store\model\store\Role as role;
use app\common\model\store\UserRole as UserRoleModel; use app\common\model\store\UserRole as UserRoleModel;
use app\common\model\MerchantGoodsCate; use app\common\model\MerchantGoodsCate;
use app\api\model\Category;
use think\Db; use think\Db;
/** /**
* 商户ID、商店ID 隔离商城里面的商户 * 商户ID、商店ID 隔离商城里面的商户
@ -209,7 +210,15 @@ class Merchant extends Controller
return $this->renderSuccess(compact("merchant")); return $this->renderSuccess(compact("merchant"));
} }
public function getShopCategory(): Json{
$merchantId = $this->merchantId;
$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'));
}

@ -8,4 +8,5 @@
"/goods/import", "/goods/import",
"/merchant/getMerchantGoodsCate", "/merchant/getMerchantGoodsCate",
"/merchant/setMerchantGoodsCate", "/merchant/setMerchantGoodsCate",
"/merchant/getShopCategory",
]; ];
Loading…
Cancel
Save