From d179220dd0d93e0b93eecf039c50529a1f043213 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 27 Sep 2023 21:46:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=93=E5=AD=98=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 5 ++--- app/controller/api/server/StoreProduct.php | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index d647b66f..fe32198f 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -69,7 +69,7 @@ class ProductRepository extends BaseRepository protected $dao; const CREATE_PARAMS = [ - "image", "slider_image", "store_name", "store_info", "keyword", "bar_code", "guarantee_template_id", "cate_id", "mer_cate_id", "unit_name", "sort" , "is_show", "is_good", 'is_gift_bag', 'integral_rate', "video_link", "temp_id", "content", "spec_type", "extension_type", "attr", 'mer_labels', 'delivery_way', 'delivery_free','param_temp_id','extend', 'source_product_id', 'stock_num', + "image", "slider_image", "store_name", "store_info", "keyword", "bar_code", "guarantee_template_id", "cate_id", "mer_cate_id", "unit_name", "sort" , "is_show", "is_good", 'is_gift_bag', 'integral_rate', "video_link", "temp_id", "content", "spec_type", "extension_type", "attr", 'mer_labels', 'delivery_way', 'delivery_free','param_temp_id','extend', 'source_product_id', 'stock_num', 'stock', ["brand_id",0], ['once_max_count',0], ['once_min_count',0], @@ -455,7 +455,6 @@ class ProductRepository extends BaseRepository if($data['integral_rate'] > 100) $integral_rate = 100; } - $result = [ 'store_name' => $data['store_name'], 'image' => $data['image'], @@ -2267,7 +2266,7 @@ class ProductRepository extends BaseRepository } } foreach ($data['attrValue'] as $k => $item) { - $data['attrValue'][$k]['stock'] = 0; + //$data['attrValue'][$k]['stock'] = 0; } app()->make(ProductLabelRepository::class)->checkHas($merId,$data['mer_labels']); $count = app()->make(StoreCategoryRepository::class)->getWhereCount(['store_category_id' => $data['cate_id'],'is_show' => 1]); diff --git a/app/controller/api/server/StoreProduct.php b/app/controller/api/server/StoreProduct.php index 81c9264c..48410799 100644 --- a/app/controller/api/server/StoreProduct.php +++ b/app/controller/api/server/StoreProduct.php @@ -85,6 +85,9 @@ class StoreProduct extends BaseController $data = $this->repository->checkParams($res,$merId); $stockNum = $data['stock_num'] ?? 0; unset($data['stock_num']); + if (!empty($data['stock'])) { + unset($data['stock']); + } $data['mer_id'] = $merId; $data['is_gift_bag'] = 0; $merchant = app()->make(MerchantRepository::class)->get($merId);