From a4304bf4c8c93060d5ace43a9c2c71cce5e6a43a Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Sun, 17 Oct 2021 23:03:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/Forms/Setting.php | 2 +- app/Providers/ProductServiceProvider.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/AdminAgent/Forms/Setting.php b/app/AdminAgent/Forms/Setting.php index 568eed3..06ad22b 100644 --- a/app/AdminAgent/Forms/Setting.php +++ b/app/AdminAgent/Forms/Setting.php @@ -36,7 +36,7 @@ class Setting extends Form ->help('订单超时时间,单位:分钟。超过该时间未支付,订单将自动关闭'); $this->radio('auto_shelves')->when([1], function (Form $form) { // 值为1和4时显示文本框 - $form->number('profit','利润(%)')->min(0)->max(100)->help('请填写利润百分比 上架商品会自动根据供应商提供的价格 上调设置值的百分比'); + //$form->number('profit','利润(%)')->min(0)->max(100)->help('请填写利润百分比 上架商品会自动根据供应商提供的价格 上调设置值的百分比'); $form->radio('auto_category','自动添加分类')->options([ '否', '是', diff --git a/app/Providers/ProductServiceProvider.php b/app/Providers/ProductServiceProvider.php index f2b0383..3aaba31 100644 --- a/app/Providers/ProductServiceProvider.php +++ b/app/Providers/ProductServiceProvider.php @@ -73,11 +73,11 @@ class ProductServiceProvider extends ServiceProvider $agentProduct->content = $product->content; $agentProduct->know = $product->know; //计算价格 - $profit = AgentSetting::val($v, 'profit') ?? 0; - $price = bcmul($product->price, bcdiv($profit + 100, 100, 6), 6); + // $profit = AgentSetting::val($v, 'profit') ?? 0; + // $price = bcmul($product->price, bcdiv($profit + 100, 100, 6), 6); - $agentProduct->price = $price; - $agentProduct->original_price = $price; + $agentProduct->price = $product->price; + $agentProduct->original_price = $product->original_price; //自动添加分类 $autoCategory = AgentSetting::val($v, 'auto_category') ?? 0; @@ -107,8 +107,8 @@ class ProductServiceProvider extends ServiceProvider 'agent_product_id' => $agentProduct->id, 'product_spec_id' => $spec->id, 'stock' => $spec->stock, - 'original_price' => bcmul($spec->price, bcdiv($profit + 100, 100, 6), 6), - 'price' => bcmul($spec->price, bcdiv($profit + 100, 100, 6), 6), + 'original_price' => $spec->original_price, + 'price' => $spec->price, ]; }