From 048e5e8d0da8b9da2c0fcce0d884277a486c89e6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 26 Jun 2024 15:11:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E5=95=86=E5=93=81=E4=BB=B7=E6=A0=BC=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/lists/cart/CartList.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/app/store/lists/cart/CartList.php b/app/store/lists/cart/CartList.php index 83f7939f2..36d01580f 100644 --- a/app/store/lists/cart/CartList.php +++ b/app/store/lists/cart/CartList.php @@ -57,9 +57,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists ->toArray(); $off_activity = Config::where('name', 'off_activity')->value('value'); $this->off_activity = $off_activity; - $user = User::where('id', $userId)->find(); foreach ($list as $key => &$item) { - $find = StoreBranchProduct::where(['product_id' => $item['product_id'], 'store_id' => $item['store_id']]) ->field('product_id,image,price,cost,store_name,unit,delete_time,vip_price') ->withTrashed() @@ -68,20 +66,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists if ($find) { if ($off_activity == 1) { $this->activity_price = bcadd(bcmul($find['cost'], $item['cart_num'], 2), $this->activity_price, 2); - } else { - if ($user && $user['user_ship'] == 1) { - //更新 会员为1的时候原价减去会员价 - $deduction_price_count = bcmul(bcsub($find['price'], $find['vip_price'], 2), $item['cart_num'], 2); - $this->activity_price = bcadd($this->activity_price, $deduction_price_count, 2); - } elseif ($user && $user['user_ship'] == 4) { - //更新 为4商户的时候减去商户价格 - $deduction_price_count = bcmul(bcsub($find['price'], $find['cost'], 2), $item['cart_num'], 2); - $this->activity_price = bcadd($this->activity_price, $deduction_price_count, 2); - } else { - $this->activity_price = 0; - } } - $item['goods_total_price'] = bcmul($item['cart_num'], $find['price'], 2); $this->total_price = bcadd($this->total_price, $item['goods_total_price'], 2); $item['image'] = $find['image']; @@ -117,7 +102,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists 'off_activity' => $this->off_activity, 'total_price' => $this->total_price, 'msg' => '', - 'pay_price' => bcsub($this->total_price, $this->activity_price, 2) + 'pay_price' => $this->total_price ]; if ($this->off_activity == 1) { $data['pay_price'] = $this->activity_price; From 02c492c1a41c9dafe93f2e1053aeefc45de2209f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 26 Jun 2024 15:12:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(CartList):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E4=BB=B7=E6=A0=BC=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/order/CartList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/lists/order/CartList.php b/app/api/lists/order/CartList.php index 2ca53b8d6..c7c4ed8be 100644 --- a/app/api/lists/order/CartList.php +++ b/app/api/lists/order/CartList.php @@ -110,7 +110,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists 'off_activity' => $this->off_activity, 'total_price' => $this->total_price, 'msg' => '', - 'pay_price' => bcsub($this->total_price, $this->activity_price, 2) + 'pay_price' => $this->total_price ]; if($this->off_activity==1){ $data['pay_price']=$this->activity_price;