From 53004e4b9d66602b675a3453a79ca7a00fc69d30 Mon Sep 17 00:00:00 2001 From: nizongfeng Date: Thu, 25 Nov 2021 17:16:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/dao/OrderHotelDao.php | 2 ++ application/admin/dao/OrderItemDao.php | 2 ++ application/admin/dao/PurchaseDao.php | 9 ++------- application/admin/service/OrderMainService.php | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/application/admin/dao/OrderHotelDao.php b/application/admin/dao/OrderHotelDao.php index a02f521..541a2c8 100644 --- a/application/admin/dao/OrderHotelDao.php +++ b/application/admin/dao/OrderHotelDao.php @@ -66,6 +66,8 @@ class OrderHotelDao "customer_name" => $param['customer_name'], "customer_comments" => empty($param['customer_comments'])?"":$param['customer_comments'], "trade_order_number" => $param['trade_order_number'], + "purchase_user_id" => $param['purchase_user_id'], + "purchase_user" => $param['purchase_user'], "del_flag"=>0 ]; $orderHotelModel = new OrderHotel(); diff --git a/application/admin/dao/OrderItemDao.php b/application/admin/dao/OrderItemDao.php index bef7f56..14a398f 100644 --- a/application/admin/dao/OrderItemDao.php +++ b/application/admin/dao/OrderItemDao.php @@ -52,6 +52,8 @@ class OrderItemDao "customer_name" => $param['customer_name'], "customer_comments" => empty($param['customer_comments'])?"":$param['customer_comments'], "trade_order_number" => $param['trade_order_number'], + "purchase_user_id" => $param['purchase_user_id'], + "purchase_user" => $param['purchase_user'], "del_flag"=>0 ]; $model = new OrderItem(); diff --git a/application/admin/dao/PurchaseDao.php b/application/admin/dao/PurchaseDao.php index 53002ad..c771c4c 100644 --- a/application/admin/dao/PurchaseDao.php +++ b/application/admin/dao/PurchaseDao.php @@ -30,12 +30,7 @@ class PurchaseDao if (!$suplierRe['flag']) { return $suplierRe; } - //2.获取负责人昵称 - $adminDao = new AdminDao(); - $adminRe = $adminDao->getInfoById($param['purchase_user_id']); - if (!$adminRe['flag']) { - return $adminRe; - } + $data = [ "order_id" => $hotelOrder['order_id'], "prod_type" => 'hotel', @@ -49,7 +44,7 @@ class PurchaseDao "supplier_id" => $param['supplier_id'], "supplier_name" => $suplierRe['data']['supplier_name'], "purchase_user_id" => $param['purchase_user_id'], - "purchase_user" => $adminRe['data']['nickname'], + "purchase_user" => $param['purchase_user'], "del_flag"=>0 ]; diff --git a/application/admin/service/OrderMainService.php b/application/admin/service/OrderMainService.php index eefec4a..773d576 100644 --- a/application/admin/service/OrderMainService.php +++ b/application/admin/service/OrderMainService.php @@ -3,6 +3,7 @@ namespace app\admin\service; use app\admin\command\Util; +use app\admin\dao\AdminDao; use app\admin\dao\OrderHotelDao; use app\admin\dao\OrderItemDao; use app\admin\dao\OrderMainDao; @@ -47,6 +48,13 @@ class OrderMainService //循环子订单 foreach ($param['subOrderList'] as $subOrderParam) { $subOrderParam['group_id'] = $param['group_id']; + //2.获取负责人昵称 + $adminDao = new AdminDao(); + $adminRe = $adminDao->getInfoById($subOrderParam['purchase_user_id']); + if (!$adminRe['flag']) { + return $adminRe; + } + $subOrderParam['purchase_user'] = $adminRe['data']['nickname']; /** * 2.添加子订单 有则激活更新、无则添加 */ @@ -122,6 +130,13 @@ class OrderMainService { $orderId = $subOrderParam['order_id']; $orderMainDao = new OrderMainDao(); + //2.获取负责人昵称 + $adminDao = new AdminDao(); + $adminRe = $adminDao->getInfoById($subOrderParam['purchase_user_id']); + if (!$adminRe['flag']) { + return $adminRe; + } + $subOrderParam['purchase_user'] = $adminRe['data']['nickname']; /** * 2.添加子订单 */