From 514b2feab1564e76152e728700e9282843ba9a4d Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 6 Sep 2023 16:31:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B8=82=E7=BA=A7=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E9=93=BE=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderRepository.php | 7 +++++-- app/controller/api/server/StoreProduct.php | 8 ++++++-- app/controller/merchant/store/product/Product.php | 13 ++++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index db8f870c..4c059b04 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -18,6 +18,7 @@ use app\common\model\store\order\StoreOrderInterest; use app\common\model\store\order\StoreRefundOrder; use app\common\model\store\product\PurchaseRecord; use app\common\model\user\User; +use app\common\model\system\merchant\Merchant; use app\common\repositories\BaseRepository; use app\common\repositories\delivery\DeliveryOrderRepository; use app\common\repositories\store\coupon\StoreCouponRepository; @@ -2456,9 +2457,11 @@ class StoreOrderRepository extends BaseRepository $mer_cate['level']=1; $mer_cate_id=Db::name('store_category')->insertGetId($mer_cate); } - $type=Db::name('merchant')->where('mer_id',$merId)->value('type_id'); + // $type=Db::name('merchant')->where('mer_id',$merId)->value('type_id'); + $typeCode=Db::name('merchant_type')->where('mer_type_id',$merId)->value('type_code'); $product_type=0; - if ($type==12){ + // if ($type==12){ + if ($typeCode==Merchant::TypeCode['TypeSupplyChain']){ $product_type=98;//供应链 } foreach ($data as $datum) { diff --git a/app/controller/api/server/StoreProduct.php b/app/controller/api/server/StoreProduct.php index 9573c9ca..2a9bdfb5 100644 --- a/app/controller/api/server/StoreProduct.php +++ b/app/controller/api/server/StoreProduct.php @@ -60,7 +60,9 @@ class StoreProduct extends BaseController [$page, $limit] = $this->getPage(); $where = $this->request->params(['cate_id', 'keyword', ['type',20], 'mer_cate_id', 'is_gift_bag', 'status', 'us_status', 'product_id', 'mer_labels',['order','sort']]); $merchant = app()->make(MerchantRepository::class)->get($merId); - if ($merchant['type_id']==12){ + $typeCode=Db::name('merchant_type')->where('mer_type_id',$merchant['type_id'])->value('type_code'); + // if ($merchant['type_id']==12){ + if ($typeCode==Merchant::TypeCode['TypeSupplyChain']){ $product_type=98;//供应链 }else{ $product_type=0;//普通商品 @@ -87,7 +89,9 @@ class StoreProduct extends BaseController $data['status'] = $merchant->is_audit ? 0 : 1; $data['mer_status'] = ($merchant['is_del'] || !$merchant['mer_state'] || !$merchant['status']) ? 0 : 1; $data['rate'] = 3; - if ($merchant['type_id']==12){ + $typeCode=Db::name('merchant_type')->where('mer_type_id',$merchant['type_id'])->value('type_code'); + // if ($merchant['type_id']==12){ + if ($typeCode==Merchant::TypeCode['TypeSupplyChain']){ $product_type=98;//供应链 }else{ $product_type=0;//普通商品 diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index b0836968..4e4369d0 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -52,7 +52,10 @@ class Product extends BaseController $where = $this->request->params(['temp_id','cate_id','keyword',['type',1],'mer_cate_id','is_gift_bag','status','us_status','product_id','mer_labels',['order','sort'],'is_ficti','svip_price_type']); $where = array_merge($where,$this->repository->switchType($where['type'],$this->request->merId(),0)); $type=$this->request->merchant()['type_id']; - if ($type==12){ + $typeCode=Db::name('merchant_type')->where('mer_type_id',$type)->value('type_code'); + $product_type=0; + // if ($type==12){ + if ($typeCode==Merchant::TypeCode['TypeSupplyChain']){ $where['product_type']=98;//供应链 } return app('json')->success($this->repository->getList($this->request->merId(),$where, $page, $limit)); @@ -87,7 +90,9 @@ class Product extends BaseController $data['status'] = $this->request->merchant()->is_audit ? 0 : 1; $data['mer_status'] = ($this->request->merchant()->is_del || !$this->request->merchant()->mer_state || !$this->request->merchant()->status) ? 0 : 1; $data['rate'] = 3; - if ($this->request->merchant()->type_id==12){ + $typeCode=Db::name('merchant_type')->where('mer_type_id',$this->request->merchant()->type_id)->value('type_code'); + // if ($this->request->merchant()->type_id==12){ + if ($typeCode==Merchant::TypeCode['TypeSupplyChain']){ $product_type=98;//供应链 }else{ $product_type=0;//普通商品 @@ -164,7 +169,9 @@ class Product extends BaseController { $type=$this->request->merchant()['type_id']; $product_type=0; - if ($type==12){ + $typeCode=Db::name('merchant_type')->where('mer_type_id',$type)->value('type_code'); + // if ($type==12){ + if ($typeCode==Merchant::TypeCode['TypeSupplyChain']){ $product_type=98;//供应链 } return app('json')->success($this->repository->getFilter($this->request->merId(),'商品',$product_type));