From 475453cfe9bd60d187a476aa8e7469062b7a6c3f Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Tue, 19 Mar 2024 10:23:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E6=89=B9?= =?UTF-8?q?=E5=8F=91=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repositories/store/product/ProductRepository.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 520634f8..0221f939 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -66,7 +66,7 @@ class ProductRepository extends BaseRepository public $saleType; protected $dao; const CREATE_PARAMS = [ - "is_copy", "image", "slider_image", "store_name", "store_info", "keyword", "bar_code", "guarantee_template_id", "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', 'mer_form_id', + "is_copy", "image", "slider_image", "store_name", "store_info", "keyword", "bar_code", "guarantee_template_id", "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', 'mer_form_id','wholesale_price', ["mer_cate_id", []], ['refund_switch', 1], ["brand_id", 0], @@ -235,8 +235,10 @@ class ProductRepository extends BaseRepository $admin_info = $data['admin_info'] ?? []; unset($data['admin_info']); } - +// dump($data); $product = $this->setProduct($data); + $product['wholesale_price'] = 11; +// halt($product); event('product.create.before', compact('data', 'productType', 'conType')); return Db::transaction(function () use ($data, $productType, $conType, $content, $product, $admin_info) { $activity_id = 0; @@ -305,6 +307,7 @@ class ProductRepository extends BaseRepository $product['admin_info'] = $data['admin_info']; unset($data['admin_info']); } + return Db::transaction(function () use ($id, $data, $productType, $settleParams, $content, $product, $spuData, $merId) { $productData = $this->save($id, $settleParams, $content, $product, $productType); if ($productType == 1) { //秒杀商品 @@ -527,6 +530,7 @@ class ProductRepository extends BaseRepository 'refund_switch' => $data['refund_switch'] ?? 0, 'mer_form_id' => $data['mer_form_id'] ?? 0, 'rate' => $data['rate'] ?? 5.0, + 'wholesale_price'=>$data['wholesale_price'] ??0 ]; if (isset($data['extend'])) $result['extend'] = $data['extend'] ? json_encode($data['extend'], JSON_UNESCAPED_UNICODE) : '';