From da2f12b219cfd170947b23f6e1d1aa0fc29e8a4d Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 8 Jun 2024 10:10:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E4=B8=8B?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A2=E5=8D=95=E4=BB=B7=E6=A0=BC=E4=B8=BA?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=9A=84=E5=B8=82=E5=9C=BA=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 259efe60a..dcb768d8f 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -57,11 +57,15 @@ class OrderLogic extends BaseLogic try { self::$total = 0; /** 计算价格 */ + $check = DictType::where('type','activities')->find(); foreach ($cart_select as $k => $v) { - $find = StoreBranchProduct::where(['id' => $v['goods']])->field('store_name,image,unit,price')->find(); + $find = StoreBranchProduct::where(['id' => $v['goods']])->field('store_name,image,unit,price,product_id')->find(); if (!$find) { continue; } + if(isset($check) && $check['status'] == 1){ + $find['price'] = StoreProduct::where('product_id',$find['product_id'])->value('ot_price'); + } $cart_select[$k]['total'] = bcmul($v['cart_num'], $find['price'], 2);//钱 $cart_select[$k]['price'] = $find['price']; $cart_select[$k]['product_id'] = $v['goods']; @@ -87,7 +91,6 @@ class OrderLogic extends BaseLogic //TODO 收单打9.9折 会员按照比例打折 等级按照充值去升级 $pay_price = self::$total; // $check = StoreOrder::where('uid',\request()->userId)->count();//首单逻辑 - $check = DictType::where('type','activities')->find(); $vipPrice = 0; if(isset($check) && $check['status'] == 1){ // $discountRate = '0.99';//首单逻辑