diff --git a/app/controller/api/server/StoreProduct.php b/app/controller/api/server/StoreProduct.php index a2425d5f..fd7c0966 100644 --- a/app/controller/api/server/StoreProduct.php +++ b/app/controller/api/server/StoreProduct.php @@ -82,10 +82,16 @@ class StoreProduct extends BaseController public function create($merId, StoreProductValidate $validate) { $res = $this->request->params($this->repository::CREATE_PARAMS); + $merchant = app()->make(MerchantRepository::class)->get($merId); + if(isset($res['cate_id']) && $res['cate_id'] <0){ + $type_code=Db::name('merchant_type')->where('mer_type_id',$merchant['merchant']['type_id'])->value('type_code'); + if($type_code=='PersonalStore'){ + $res['cate_id']=2231; + } + } $data = $this->repository->checkParams($res, $merId); $data['mer_id'] = $merId; $data['is_gift_bag'] = 0; - $merchant = app()->make(MerchantRepository::class)->get($merId); $data['status'] = $merchant->is_audit ? 0 : 1; $data['mer_status'] = ($merchant['is_del'] || !$merchant['mer_state'] || !$merchant['status']) ? 0 : 1; $data['rate'] = 3;