From 95262ab5afa8291fe503b4a67f2273f6b2cbcf20 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 19 Dec 2024 17:34:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E6=B7=BB=E5=8A=A0=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E4=BB=B7=E6=A0=BC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在预订单逻辑中增加会员价格计算 - 在仓库产品逻辑中添加会员价格字段 --- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 5 +++++ app/admin/logic/warehouse_product/WarehouseProductLogic.php | 1 + 2 files changed, 6 insertions(+) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 3f13d8eec..a3fa8edd9 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -370,6 +370,9 @@ class BeforehandOrderLogic extends BaseLogic if ($count > 0) { throw new BusinessException('订单中有数量为0的商品,请先处理'); } + if($order['uid']>0){ + $user_ship=User::where('id', $order['uid'])->value('user_ship')??0; + } Db::startTrans(); try { $arr = [ @@ -386,6 +389,7 @@ class BeforehandOrderLogic extends BaseLogic $arr['delivery_time'] = strtotime($delivery_time); $res = WarehouseOrder::create($arr); foreach ($info as $key => $arr) { + $price=StoreProductGroupPrice::where('product_id',$arr['product_id'])->where('group_id',$user_ship)->value('price')??0; $data = [ 'warehouse_id' => $warehouse_id, 'product_id' => $arr['product_id'], @@ -398,6 +402,7 @@ class BeforehandOrderLogic extends BaseLogic 'admin_id' => $admin_id, 'total_price' => $arr['total_price'], 'price' => $arr['price'], + 'vip_price' => $price==0?$arr['price']:$price, 'purchase' => $arr['purchase'], 'oid' => $res['id'], 'code' => $res['code'], diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index 681e0699a..905ad4413 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -167,6 +167,7 @@ class WarehouseProductLogic extends BaseLogic 'after_nums' => $after_nums, 'price' => $params['price'] ?? 0, 'purchase' => $params['purchase'] ?? 0, + 'vip_price' => $params['vip_price'] ?? 0, 'total_price' => $params['total_price'] ?? 0, 'admin_id' => $params['admin_id'], 'code' => $params['code'] ?? '',