From 8aa2740b5025e67159024cc6759f43bcd6f55080 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Thu, 3 Apr 2025 16:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E4=BC=9A=E5=91=98=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/beforehand_order/BeforehandOrderLogic.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 170f83c8..abb72bc6 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -968,16 +968,13 @@ class BeforehandOrderLogic extends BaseLogic $v['store_name'] = $find['store_name']; $v['mark'] = $find['after_sales']; if (isset($params['type']) && $params['type'] == 2) { - $v['price'] = $v['cost']; //出库单价 - $v['total_price'] = bcmul($v['price'], $v['nums'], 2); //出库总价 + $v['price'] = $v['vip_price']; //出库单价 + $v['purchase'] = $v['cost']; //高级会员单,供货价=商户价 } else { - if ($v['vip_price'] > 0) { - $v['total_price'] = bcmul($v['vip_price'], $v['nums'], 2); - } else { - $v['total_price'] = bcmul($v['price'], $v['nums'], 2); - } + $v['purchase'] = $v['vip_price'] > 0 ? $v['vip_price'] : $v['price']; //会员单,供货价=会员价 } + $v['total_price'] = bcmul($v['price'], $v['nums'], 2); //出库总价 $v['pay_price'] = bcmul($v['purchase'], $v['nums'], 2); //供货总价 $v['profit'] = bcsub($v['total_price'], $v['pay_price'], 2); $total_profit = bcadd($total_profit, $v['profit'], 2);