From b59e9b8bfbe2d9a89d5eca1a01b62635c90bf3e9 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 5 Dec 2024 17:30:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor(xlsx):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BE=9B=E8=B4=A7=E5=87=BA=E5=BA=93=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E7=9A=84=E5=88=97=E6=A0=87=E9=A2=98=E5=92=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将"E3"单元格的标题从"供货价"改为"出库单价" - 将"F3"单元格的标题从"出库价"改为"供货价" - 将"G3"单元格的标题从"出库总价"改为"供货总价" - 相应地调整了数据填充的顺序,确保与新的列标题一致 --- app/common/service/xlsx/OrderSupplyOutbound.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/common/service/xlsx/OrderSupplyOutbound.php b/app/common/service/xlsx/OrderSupplyOutbound.php index 1e1bf532..418877a0 100644 --- a/app/common/service/xlsx/OrderSupplyOutbound.php +++ b/app/common/service/xlsx/OrderSupplyOutbound.php @@ -47,9 +47,9 @@ class OrderSupplyOutbound $sheet->setCellValue('B3', '品名'); $sheet->setCellValue('C3', '单位'); $sheet->setCellValue('D3', '数量'); - $sheet->setCellValue('E3', '供货价'); - $sheet->setCellValue('F3', '出库价'); - $sheet->setCellValue('G3', '出库总价'); + $sheet->setCellValue('E3', '出库单价'); + $sheet->setCellValue('F3', '供货价'); + $sheet->setCellValue('G3', '供货总价'); $sheet->setCellValue('H3', '备注'); // 设置默认的单元格样式 @@ -68,8 +68,8 @@ class OrderSupplyOutbound $sheet->setCellValue('B' . ($k + 4), $v['store_name']); $sheet->setCellValue('C' . ($k + 4), $v['unit_name']); $sheet->setCellValue('D' . ($k + 4), $v['nums']); - $sheet->setCellValue('E' . ($k + 4), $v['purchase']); - $sheet->setCellValue('F' . ($k + 4), $v['price']); + $sheet->setCellValue('E' . ($k + 4), $v['price']); + $sheet->setCellValue('F' . ($k + 4), $v['purchase']); $sheet->setCellValue('G' . ($k + 4), $v['total_price']); $sheet->mergeCells('H' . ($k + 4) . ':I' . $k + 4); $sheet->setCellValue('H' . ($k + 4), $v['mark']); From 4661071c65a7312565c7d45569a5a5efd40aef5f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 16 Dec 2024 11:33:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E5=A4=8D=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E9=A2=84=E8=AE=A2=E5=8D=95=E7=94=A8=E6=88=B7id?= =?UTF-8?q?=E4=B8=BA0=E6=97=B6=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在处理预订单时,增加了对用户id的检查 - 如果用户id为0,抛出"用户id不能为0"的异常 - 修改了购买价格的计算逻辑,使用用户所属的团体id来获取价格 --- .../logic/beforehand_order/BeforehandOrderLogic.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 13fdc5bc..418b1f08 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -849,7 +849,14 @@ class BeforehandOrderLogic extends BaseLogic } $order['admin_name'] = Admin::where('id', $order['admin_id'])->value('name'); $data = WarehouseProduct::where('oid', $order['outbound_id'])->where('nums', '>', 0)->select(); - + if($order['uid']>0){ + $user_ship = User::where('id', $order['uid'])->value('user_ship'); + if($user_ship==0){ + throw new BusinessException('用户id不能为0'); + } + }else{ + throw new BusinessException('用户id不能为0'); + } $total_price = 0; $pay_price = 0; $total_profit = 0; @@ -858,7 +865,7 @@ class BeforehandOrderLogic extends BaseLogic $v['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name'); $v['store_name'] = $find['store_name']; $v['mark'] = $find['after_sales']; - $v['purchase']=StoreProductGroupPrice::where('product_id',$v['product_id'])->where('group_id',18)->value('price'); + $v['purchase']=StoreProductGroupPrice::where('product_id',$v['product_id'])->where('group_id',$user_ship)->value('price'); if($v['purchase']){ $v['pay_price'] = bcmul($v['purchase'], $v['nums'], 2); }else{