From 4c3e59333157d70886653b0092ebc37ea8a973f5 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 2 Dec 2024 14:47:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E6=AD=A3=E9=A2=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=87=BA=E5=BA=93=E9=87=91=E9=A2=9D=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 WarehouseProduct 模型计算出库金额,而非直接从 WarehouseOrder 获取 - 遍历出库产品,累加每个产品的采购价与数量的乘积 - 更新列表字段名称:将"出库金额"改为"出库门店金额","入库金额"改为"入库采购金额" --- .../beforehand_order/BeforehandOrderLists.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index c49ee3872..a4d897c57 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -13,6 +13,7 @@ use app\common\lists\ListsExcelInterface; use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; use app\common\model\store_order\StoreOrder; use app\common\model\warehouse_order\WarehouseOrder; +use app\common\model\warehouse_product\WarehouseProduct; /** * 预订单表列表 @@ -188,10 +189,14 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte } } if($item['outbound_id']>0){ - $warehouseOrder=WarehouseOrder::where('id',$item['outbound_id'])->field('code,total_price')->find(); - if($warehouseOrder){ - $order_ck=$warehouseOrder['code']; - $outbound_price=$warehouseOrder['total_price']; + $order_ck=WarehouseOrder::where('id',$item['outbound_id'])->value('code'); + if($order_ck){ + $total_price=0; + $arr= WarehouseProduct::where('oid',$item['outbound_id'])->field('nums,purchase')->select(); + foreach ($arr as $k=>$v){ + $total_price+=bcmul($v['nums'],$v['purchase'],2); + } + $outbound_price=$total_price; } } $nickname = $item->other_data?->nickname??''; @@ -257,9 +262,9 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte 'system_store' => '门店', 'admin_name' => '门店', 'warehousing' => '入库', - 'warehousing_price' => '入库金额', + 'warehousing_price' => '入库采购金额', 'outbound' => '出库', - 'outbound_price' => '出库金额', + 'outbound_price' => '出库门店金额', 'total_price' => '总价', 'admin_name' => '用户', 'mark' => '备注', From 33f0aab0c8877d12a82c6a9040b9764e8c45a08b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 2 Dec 2024 14:53:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(admin):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8F=90=E5=89=8D=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E9=87=91=E9=A2=9D=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将"出库门店金额"改为"出库门店供货金额" - 这个改动更准确地描述了出库金额的性质,避免用户混淆 --- app/admin/lists/beforehand_order/BeforehandOrderLists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index a4d897c57..af9dd6cee 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -264,7 +264,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte 'warehousing' => '入库', 'warehousing_price' => '入库采购金额', 'outbound' => '出库', - 'outbound_price' => '出库门店金额', + 'outbound_price' => '出库门店供货金额', 'total_price' => '总价', 'admin_name' => '用户', 'mark' => '备注',