From 14d0f838fd80fa403462caf0e8caa54ce9dc8735 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 19 Jun 2024 14:19:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95=E4=B8=BA?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AD=89=E7=BA=A71=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 3 ++- app/common/logic/store_order/StoreOrderLogic.php | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index e95c756a..dcfa9efa 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -84,12 +84,13 @@ class OrderLogic extends BaseLogic $cart_select[$k]['cost'] = $find['cost']; $cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价 $cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额 - + $cart_select[$k]['vip'] = 0; if ($user && $user['user_ship'] == 1) { //更新 会员为1的时候原价减去会员价 $deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2); $cart_select[$k]['deduction_price'] =$deduction_price_count; self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2); + $cart_select[$k]['vip'] =1; } if ($user && $user['user_ship'] == 4) { //更新 为4商户的时候减去商户价格 diff --git a/app/common/logic/store_order/StoreOrderLogic.php b/app/common/logic/store_order/StoreOrderLogic.php index 972e4ebe..b5e6bf98 100644 --- a/app/common/logic/store_order/StoreOrderLogic.php +++ b/app/common/logic/store_order/StoreOrderLogic.php @@ -61,12 +61,13 @@ class StoreOrderLogic extends BaseLogic $cart_select[$k]['cost'] = $find['cost']; $cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价 $cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额 - + $cart_select[$k]['vip'] = 0; if ($user && $user['user_ship'] == 1) { //更新 会员为1的时候原价减去会员价 $deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2); $cart_select[$k]['deduction_price'] =$deduction_price_count; self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2); + $cart_select[$k]['vip'] =1; } if ($user && $user['user_ship'] == 4) { @@ -223,6 +224,12 @@ class StoreOrderLogic extends BaseLogic $order['refund_type_name'] = OrderEnum::refundType($order['refund_type']) ?? ''; $order['pay_type_name'] =PayEnum::getPaySceneDesc($order['pay_type']) ?? ''; + $detail =StoreOrderCartInfo::where('oid',$order['id'])->find()->toArray(); + $vip =0; + if(isset($detail['cart_info']['vip']) && $detail['cart_info']['vip'] == 1){ + $vip = 1; + } + $order['vip'] = $vip; return $order->toArray(); }