From 65ce4808c93d10d07ad1e1fc0ba72c74b6b0505c Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Wed, 18 Dec 2024 17:44:44 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=8D=95=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PurchaseProductOfferLists.php | 16 ++++++ .../PurchaseProductOfferLogic.php | 53 +++++++++++++------ .../PurchaseProductOffer.php | 2 + 3 files changed, 56 insertions(+), 15 deletions(-) diff --git a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php index 5d72a652f..05e5f5d9e 100644 --- a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -49,6 +49,14 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc */ public function lists(): array { + $procurementOrderId = PurchaseProductOffer::where('source_order_id', $this->params['order_id'])->value('source_order_id'); + if ($procurementOrderId) { + foreach ($this->searchWhere as $k => &$v) { + if ($v[0] == 'order_id') { + $v[2] = $procurementOrderId; + } + } + } $store_name=$this->request->get('store_name'); if($store_name){ $ids=StoreProduct::where('store_name','like','%'.$store_name.'%')->column('id'); @@ -125,6 +133,14 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc if($this->is_ids==1){ return 0; } + $procurementOrderId = PurchaseProductOffer::where('source_order_id', $this->params['order_id'])->value('source_order_id'); + if ($procurementOrderId) { + foreach ($this->searchWhere as $k => &$v) { + if ($v[0] == 'order_id') { + $v[2] = $procurementOrderId; + } + } + } return PurchaseProductOffer::where($this->searchWhere)->count(); } diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 7ca280fb6..c00169aa0 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -56,21 +56,44 @@ class PurchaseProductOfferLogic extends BaseLogic $mark = BeforehandOrderCartInfo::where('bhoid', $params['order_id'])->where('product_id', $params['product_id'])->value('mark'); } $find=StoreProduct::where('id',$params['product_id'])->find(); - PurchaseProductOffer::create([ - 'order_id' => $procurementOrder['id'], - 'product_id' => $params['product_id'], - 'unit' => $params['unit'], - 'is_buyer' => $params['is_buyer'], - 'need_num' => $params['need_num'], - 'mark' => $mark, - 'buyer_id' => $params['buyer_id'], - 'package' => $find['package'], - 'store_info' => $find['store_info'], - 'marques' => $find['marques'], - 'after_sales' => $find['after_sales'], - 'status' => 0, - - ]); + $purchaseProductOffer = PurchaseProductOffer::where(['order_id' => $procurementOrder['id'], 'product_id' => $params['product_id']])->find(); + if ($purchaseProductOffer) { + $purchaseProductOffer->need_num = $purchaseProductOffer['need_num'] + $params['need_num']; + if (!empty($purchaseProductOffer['source_order_info'])) { + $sourceOrderInfo = $purchaseProductOffer['source_order_info']; + $sourceOrderInfo[] = [ + 'source_order_id' => $params['order_id'], + 'product_id' => $params['product_id'], + 'need_num' => $params['need_num'], + 'mark' => $mark, + ]; + $purchaseProductOffer->source_order_info = $sourceOrderInfo; + } + $purchaseProductOffer->save(); + } else { + PurchaseProductOffer::create([ + 'order_id' => $procurementOrder['id'], + 'product_id' => $params['product_id'], + 'unit' => $params['unit'], + 'is_buyer' => $params['is_buyer'], + 'need_num' => $params['need_num'], + 'mark' => $mark, + 'buyer_id' => $params['buyer_id'], + 'package' => $find['package'], + 'store_info' => $find['store_info'], + 'marques' => $find['marques'], + 'after_sales' => $find['after_sales'], + 'status' => 0, + 'source_order_info' => [ + [ + 'source_order_id' => $params['order_id'], + 'product_id' => $params['product_id'], + 'need_num' => $params['need_num'], + 'mark' => $mark, + ] + ] + ]); + } BeforehandOrderCartInfo::where(['bhoid' => $params['order_id'], 'product_id' => $params['product_id']])->update(['is_buyer' => 1]); Db::commit(); return true; diff --git a/app/common/model/purchase_product_offer/PurchaseProductOffer.php b/app/common/model/purchase_product_offer/PurchaseProductOffer.php index 4f76f0f99..1c6efb332 100644 --- a/app/common/model/purchase_product_offer/PurchaseProductOffer.php +++ b/app/common/model/purchase_product_offer/PurchaseProductOffer.php @@ -18,5 +18,7 @@ class PurchaseProductOffer extends BaseModel protected $name = 'purchase_product_offer'; protected $deleteTime = 'delete_time'; + protected $json = ['source_order_info']; + protected $jsonAssoc = true; } \ No newline at end of file From 2c6e3ccb819519928bf8aa3df73fb2f87e6efc71 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Thu, 19 Dec 2024 16:34:17 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=8D=95=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforehandOrderCartInfoController.php | 27 ++++++++++++++++++- .../PurchaseProductOfferLists.php | 16 ----------- .../beforehand_order/BeforehandOrderLogic.php | 2 +- .../PurchaseProductOfferLogic.php | 7 ++++- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/app/admin/controller/beforehand_order_cart_info/BeforehandOrderCartInfoController.php b/app/admin/controller/beforehand_order_cart_info/BeforehandOrderCartInfoController.php index 35226807d..9736a5ec2 100644 --- a/app/admin/controller/beforehand_order_cart_info/BeforehandOrderCartInfoController.php +++ b/app/admin/controller/beforehand_order_cart_info/BeforehandOrderCartInfoController.php @@ -6,8 +6,10 @@ namespace app\admin\controller\beforehand_order_cart_info; use app\admin\controller\BaseAdminController; use app\admin\lists\beforehand_order_cart_info\BeforehandOrderCartInfoLists; use app\admin\logic\beforehand_order_cart_info\BeforehandOrderCartInfoLogic; +use app\common\model\beforehand_order\BeforehandOrder; use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo; use app\common\model\purchase_product_offer\PurchaseProductOffer; +use app\common\model\store_product\StoreProduct; /** * 预订单购物详情表控制器 @@ -65,11 +67,34 @@ class BeforehandOrderCartInfoController extends BaseAdminController $res=BeforehandOrderCartInfo::where('id',$id)->find(); $find=PurchaseProductOffer::where(['product_id'=>$res['product_id'],'order_id'=>$res['bhoid']])->find(); + if (empty($find)) { + $rawSql = "JSON_CONTAINS(source_order_info, '{\"source_order_id\": {$res['bhoid']}}')"; + $find = PurchaseProductOffer::where(['product_id' => $res['product_id']])->whereRaw($rawSql)->find(); + } if($find){ if($find['buyer_confirm']==1){ return $this->fail('该商品已采购完成,无法更改状态'); }else{ - PurchaseProductOffer::where('id',$find['id'])->update(['delete_time'=>time()]); + if (!empty($find['source_order_info'])) { + $json = $find['source_order_info']; + foreach ($json as $key => $value) { + if ($value['source_order_id'] == $res['bhoid']) { + $find->need_num = $find->need_num - $value['need_num']; + unset($json[$key]); + break; + } + } + $find->source_order_info = array_values($json); + $productPrice = StoreProduct::where('id',$res['product_id'])->value('price'); + $procurementOrder = BeforehandOrder::where('id', $find['order_id'])->find(); + $procurementOrder->total_price = bcsub($procurementOrder->total_price, bcmul($productPrice, $res['cart_num'], 2), 2); + $procurementOrder->pay_price = $procurementOrder->total_price; + $procurementOrder->save(); + } + if ($find->need_num <= 0) { + $find->delete_time = time(); + } + $find->save(); } } $res->save(['is_buyer'=>-1]); diff --git a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php index 05e5f5d9e..5d72a652f 100644 --- a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -49,14 +49,6 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc */ public function lists(): array { - $procurementOrderId = PurchaseProductOffer::where('source_order_id', $this->params['order_id'])->value('source_order_id'); - if ($procurementOrderId) { - foreach ($this->searchWhere as $k => &$v) { - if ($v[0] == 'order_id') { - $v[2] = $procurementOrderId; - } - } - } $store_name=$this->request->get('store_name'); if($store_name){ $ids=StoreProduct::where('store_name','like','%'.$store_name.'%')->column('id'); @@ -133,14 +125,6 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc if($this->is_ids==1){ return 0; } - $procurementOrderId = PurchaseProductOffer::where('source_order_id', $this->params['order_id'])->value('source_order_id'); - if ($procurementOrderId) { - foreach ($this->searchWhere as $k => &$v) { - if ($v[0] == 'order_id') { - $v[2] = $procurementOrderId; - } - } - } return PurchaseProductOffer::where($this->searchWhere)->count(); } diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 8699bdc60..4b3d43892 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -678,7 +678,7 @@ class BeforehandOrderLogic extends BaseLogic { $order_info = new OrderInfo(); $order = BeforehandOrder::where('id', $params['id'])->find(); - if ($order['order_type'] == 7 && $params['print'] == 1) { + if ($order['order_type'] == 7 && isset($params['print']) && $params['print'] == 1) { $order->is_buying = 1; $order->save(); } diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index c00169aa0..a3445587c 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -41,7 +41,7 @@ class PurchaseProductOfferLogic extends BaseLogic { Db::startTrans(); try { - $procurementOrder = BeforehandOrder::where('order_type', 7)->where('is_buying', 0)->find(); + $procurementOrder = BeforehandOrder::where('order_type', 7)->where('is_buying', 0)->where('create_time', '>=', strtotime('-3 days'))->find(); if (empty($procurementOrder)) { $beforeOrder = BeforehandOrder::where('id', $params['order_id'])->findOrEmpty()->toArray(); unset($beforeOrder['id'], $beforeOrder['create_time'], $beforeOrder['update_time']); @@ -49,6 +49,8 @@ class PurchaseProductOfferLogic extends BaseLogic $procurementOrder->setAttrs($beforeOrder); $procurementOrder->order_id = getNewOrderId('CG'); $procurementOrder->order_type = 7; + $procurementOrder->total_price = 0; + $procurementOrder->pay_price = 0; $procurementOrder->save(); } $mark = $params['mark'] ?? ''; @@ -57,6 +59,9 @@ class PurchaseProductOfferLogic extends BaseLogic } $find=StoreProduct::where('id',$params['product_id'])->find(); $purchaseProductOffer = PurchaseProductOffer::where(['order_id' => $procurementOrder['id'], 'product_id' => $params['product_id']])->find(); + $procurementOrder->total_price = bcadd($procurementOrder->total_price, bcmul($find['price'], $params['need_num'], 2), 2); + $procurementOrder->pay_price = $procurementOrder->total_price; + $procurementOrder->save(); if ($purchaseProductOffer) { $purchaseProductOffer->need_num = $purchaseProductOffer['need_num'] + $params['need_num']; if (!empty($purchaseProductOffer['source_order_info'])) { From 48f9e077878d92a8f61482e2cdfdb4ff5c54473e Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Thu, 19 Dec 2024 16:50:28 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=87=87=E8=B4=AD=E5=8D=95=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforehandOrderCartInfoLogic.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 459ff7537..1940ed98d 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -244,7 +244,11 @@ class BeforehandOrderCartInfoLogic extends BaseLogic WarehouseProductLogic::add($data); PurchaseProductOffer::where('id', $v['id'])->update(['status' => 1, 'is_storage' => 1]); } - BeforehandOrder::where('id', $params['bhoid'])->update(['warehousing_id' => $res['id'],'is_warehousing'=>1]); + $attrs = ['warehousing_id' => $res['id'],'is_warehousing'=>1]; + if ($beforehandOrder['order_type'] == 7) { + $attrs['is_buying'] = 1; + } + BeforehandOrder::where('id', $params['bhoid'])->update($attrs); Db::commit(); return true; } catch (\Throwable $e) { From 14555837fece33e87ec2596ab77a23fe076d4622 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Thu, 19 Dec 2024 17:29:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=95=86=E5=93=81=E9=87=87=E8=B4=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforehandOrderCartInfoLists.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index 7358caddf..5768adde5 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -92,7 +92,11 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe $item['top_cate_id'] = $find['top_cate_id']; $item['top_cate_name'] = StoreCategory::where('id', $item['top_cate_id'])->value('name'); if ($item->bhoid) { - $status = PurchaseProductOffer::where('order_id', $item->bhoid)->where('product_id', $item->product_id)->value('status'); + $rawSql = "JSON_CONTAINS(source_order_info, '{\"source_order_id\": {$item->bhoid}}')"; + $status = PurchaseProductOffer::where(['product_id' => $item->product_id])->whereRaw($rawSql)->value('status'); + if (is_null($status)) { + $status = PurchaseProductOffer::where('order_id', $item->bhoid)->where('product_id', $item->product_id)->value('status'); + } if ($status == 1) { $item->status_name = '已完成'; } else { 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 5/6] =?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'] ?? '', From 195d71519b65b1068334700bacc13d8891744b27 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 20 Dec 2024 10:28:33 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat(beforehand=5Forder):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=94=A8=E6=88=B7=E7=BB=84=E6=A0=87=E9=A2=98=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95=E5=AF=BC=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在订单导出时添加用户组标题字段 - 优化订单数据查询,增加 uid 字段 - 在 OrderSupplyOutbound 服务中添加用户组标题的导出 --- app/admin/lists/beforehand_order/BeforehandOrderLists.php | 4 ++-- app/admin/logic/beforehand_order/BeforehandOrderLogic.php | 5 +++++ app/common/service/xlsx/OrderSupplyOutbound.php | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderLists.php b/app/admin/lists/beforehand_order/BeforehandOrderLists.php index 9b2e84200..d4a90faa2 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderLists.php @@ -81,9 +81,9 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte $oid=WarehouseOrder::where('financial_pm',0)->where('code','like','%'.$order_ck)->column('id'); $this->searchWhere[] = ['outbound_id','in',$oid]; } - $file=['id', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file']; + $file=['id','uid', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file']; if($export==2){ - $file=['id', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file','other_data']; + $file=['id','uid', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file','other_data']; } return BeforehandOrder::where($this->searchWhere) ->field($file) diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index a3fa8edd9..455d9a580 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -22,6 +22,7 @@ use app\common\model\store_product_unit\StoreProductUnit; use app\common\model\system_store\SystemStore; use app\common\model\user\User; use app\common\model\user\UserAddress; +use app\common\model\user_ship\UserShip; use app\common\model\warehouse_order\WarehouseOrder; use app\common\model\warehouse_product\WarehouseProduct; use app\common\model\warehouse_product_return\WarehouseProductReturn; @@ -893,6 +894,10 @@ class BeforehandOrderLogic extends BaseLogic $order['pay_price'] = $pay_price; $order['total_profit'] = $total_profit; $order['total_price'] = $total_price; + $order['group_title'] = ''; + if($user_ship){ + $order['group_title'] = UserShip::where('id',$user_ship)->value('title'); + } $file_path = $order_info->export($data, $order, $other_data, 2); return $file_path; } diff --git a/app/common/service/xlsx/OrderSupplyOutbound.php b/app/common/service/xlsx/OrderSupplyOutbound.php index 52d8f1db6..fbd6fa44d 100644 --- a/app/common/service/xlsx/OrderSupplyOutbound.php +++ b/app/common/service/xlsx/OrderSupplyOutbound.php @@ -83,6 +83,8 @@ class OrderSupplyOutbound $sheet->setCellValue('A' . ($count + 4),'合计'); $sheet->setCellValue('B' . ($count + 4),$count); + $sheet->setCellValue('J' . ($count + 4),$order['group_title']??''); + $sheet->setCellValue('A' . ($count + 5),'累计接单:'); $sheet->setCellValue('C' . ($count + 5),'预收金额:'); $sheet->setCellValue('D' . ($count + 5),0);