From 2a6f917a89e2d84e37181fd670db02389bdb1c9d Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 7 Oct 2023 14:37:56 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 279862e4..9732ab71 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -751,8 +751,10 @@ class ProductRepository extends BaseRepository $data['attrValue'] = $arr; $content = $data['content']['content'] ?? ''; + $data['content_arr'] = []; if (isset($data['content']) &&$data['content']['type']==1){ $arr = json_decode($content); + $data['content_arr'] = $arr; if($arr){ $content=''; foreach($arr->image as $k=>$v){ From 4b90e78ceef1bf248ccd5172aa20c6c034c8e7b1 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 7 Oct 2023 16:36:13 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/merchant/store/product/Product.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index 4e4369d0..d3951149 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -98,6 +98,7 @@ class Product extends BaseController $product_type=0;//普通商品 } $data['update_time'] = date('Y-m-d H:i:s'); + $data['content']=$data['content']?json_encode($data['content']):[]; $this->repository->create($data,$product_type); return app('json')->success('添加成功'); } From 49ff1bed44f7fcf89fae4dd50bd7271047a9923b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 7 Oct 2023 17:05:44 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/merchant/store/product/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index d3951149..bb279f8d 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -99,7 +99,7 @@ class Product extends BaseController } $data['update_time'] = date('Y-m-d H:i:s'); $data['content']=$data['content']?json_encode($data['content']):[]; - $this->repository->create($data,$product_type); + $this->repository->create($data,$product_type,1); return app('json')->success('添加成功'); } From d0e564533de469bbfd09eef100e27fbb7f9fbb09 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 7 Oct 2023 17:15:27 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/merchant/store/product/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index bb279f8d..c3eb83ca 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -127,7 +127,7 @@ class Product extends BaseController $data['update_time'] = date('Y-m-d H:i:s'); $typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id'); $productType = $this->request->merchant()->type_id == $typeSupplyChainId ? 98 : 0; - $this->repository->edit($id, $data, $this->request->merId(), $productType); + $this->repository->edit($id, $data, $this->request->merId(), $productType,1); return app('json')->success('编辑成功'); } From 50736e3778bc7088d4e991b5dbffa46dbd196afd Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 7 Oct 2023 17:35:39 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/merchant/store/product/Product.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index c3eb83ca..115699b5 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -98,7 +98,6 @@ class Product extends BaseController $product_type=0;//普通商品 } $data['update_time'] = date('Y-m-d H:i:s'); - $data['content']=$data['content']?json_encode($data['content']):[]; $this->repository->create($data,$product_type,1); return app('json')->success('添加成功'); } From cdc8da3aecb731369eba803ba2f290567e9f3e54 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 7 Oct 2023 17:50:57 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/merchant/store/product/Product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controller/merchant/store/product/Product.php b/app/controller/merchant/store/product/Product.php index 115699b5..e2701fa5 100644 --- a/app/controller/merchant/store/product/Product.php +++ b/app/controller/merchant/store/product/Product.php @@ -280,8 +280,8 @@ class Product extends BaseController 'spec_type' ]; $data = $this->request->params($params); - $count = app()->make(StoreCategoryRepository::class)->getWhereCount(['store_category_id' => $data['mer_cate_id'],'is_show' => 1,'mer_id' => $this->request->merId()]); - if (!$count) throw new ValidateException('商户分类不存在或不可用'); + // $count = app()->make(StoreCategoryRepository::class)->getWhereCount(['store_category_id' => $data['mer_cate_id'],'is_show' => 1,'mer_id' => $this->request->merId()]); + // if (!$count) throw new ValidateException('商户分类不存在或不可用'); $data['status'] = 1; $this->repository->freeTrial($id, $data,$this->request->merId()); return app('json')->success('编辑成功');