From b1e86f9249cc4219b8df4ecf80e472ca9e07e941 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 9 Jun 2024 15:39:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(OrderLogic):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?VIP=E4=BB=B7=E6=A0=BC=E8=AE=A1=E7=AE=97=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=94=AF=E4=BB=98=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/logic/order/OrderLogic.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 5e170d82..05134ec2 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -88,11 +88,11 @@ class OrderLogic extends BaseLogic $cartInfo['name'] = $find['store_name']; $cartInfo['image'] = $find['image']; //计算好vip价格 - $vipPrice = self::dealVip($find['price']); - if ($vipPrice) { - $cartInfo['price'] = $vipPrice; - } - $cartInfo['vip_price'] = $cart_select[$k]['total'] - $vipPrice ?? 0; + // $vipPrice = self::dealVip($find['price']); + // if ($vipPrice) { + // $cartInfo['price'] = $vipPrice; + // } + $cartInfo['vip_price'] = 0;//$cart_select[$k]['total'] - $vipPrice ?? 0; $cart_select[$k]['cart_info'] = json_encode($cartInfo); //理论上每笔都是拆分了 $cart_select[$k]['name'] = $find['store_name']; @@ -106,13 +106,13 @@ class OrderLogic extends BaseLogic $pay_price = self::$total; // $check = StoreOrder::where('uid',\request()->userId)->count();//首单逻辑 $vipPrice = 0; - if (isset($check) && $check['status'] == 1) { + // if (isset($check) && $check['status'] == 1) { // $discountRate = '0.99';//首单逻辑 // $pay_price 是价格 - $discountRate = $check['remark'];//折扣 - $discountRate = bcdiv($discountRate, '10', 2); - $pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2); - } else { + // $discountRate = $check['remark'];//折扣 + // $discountRate = bcdiv($discountRate, '10', 2); + // $pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2); + // } else { /* $userVip = User::where('id', \request()->userId)->value('user_ship'); if ($userVip) { switch ($userVip) { @@ -137,11 +137,11 @@ class OrderLogic extends BaseLogic $discountRate = bcdiv($discountRate, '100', 2); $pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2); }*/ - } - if (!empty(self::$total) && !empty($pay_price)) { - bcscale(2); - $vipPrice = bcsub(self::$total, $pay_price, 2); - } + // } + // if (!empty(self::$total) && !empty($pay_price)) { + // bcscale(2); + // $vipPrice = bcsub(self::$total, $pay_price, 2); + // } //成本价 收益 $order = [