From c6cf160d327d1e9b2993eb60801412837fcb1610 Mon Sep 17 00:00:00 2001 From: nizongfeng Date: Tue, 7 Feb 2023 18:13:46 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/dao/OrderHotelDao.php | 13 +++++++++++++ application/admin/dao/OrderItemDao.php | 13 +++++++++++++ application/admin/dao/OrderMainDao.php | 18 ++++++++++++++++++ application/admin/service/PaymentOrderService.php | 7 +++++++ application/admin/service/ReceiptOrderService.php | 5 +++++ 5 files changed, 56 insertions(+) diff --git a/application/admin/dao/OrderHotelDao.php b/application/admin/dao/OrderHotelDao.php index 8e5ff59..3d430b2 100644 --- a/application/admin/dao/OrderHotelDao.php +++ b/application/admin/dao/OrderHotelDao.php @@ -342,4 +342,17 @@ class OrderHotelDao return []; } } + + public function updatePayOrderName($id, $name) { + try{ + $data = [ + "payment_order_name"=>$name + ]; + $model = new OrderHotel(); + $model->save($data,["payment_order_id"=>$id]); + return Util::returnArrSu(); + }catch (Exception $e){ + return Util::returnArrEr("同步名称到订单失败".$e->getMessage()); + } + } } \ No newline at end of file diff --git a/application/admin/dao/OrderItemDao.php b/application/admin/dao/OrderItemDao.php index e56c4ef..abbe961 100644 --- a/application/admin/dao/OrderItemDao.php +++ b/application/admin/dao/OrderItemDao.php @@ -293,4 +293,17 @@ class OrderItemDao return []; } } + + public function updatePayOrderName($id, $name) { + try{ + $data = [ + "payment_order_name"=>$name + ]; + $model = new OrderItem(); + $model->save($data,["payment_order_id"=>$id]); + return Util::returnArrSu(); + }catch (Exception $e){ + return Util::returnArrEr("同步名称到订单失败".$e->getMessage()); + } + } } \ No newline at end of file diff --git a/application/admin/dao/OrderMainDao.php b/application/admin/dao/OrderMainDao.php index b1b7e8e..16e92c5 100644 --- a/application/admin/dao/OrderMainDao.php +++ b/application/admin/dao/OrderMainDao.php @@ -384,4 +384,22 @@ class OrderMainDao return Util::returnArrEr("将主订单从收款单下移除失败".$e->getMessage()); } } + + /** + * @param $id + * @param $name + * @return array + */ + public function updateReceiptOrderName($id, $name) { + try{ + $data = [ + "receipt_order_name"=>$name + ]; + $model = new OrderMain(); + $model->save($data,["receipt_order_id"=>$id]); + return Util::returnArrSu(); + }catch (Exception $e){ + return Util::returnArrEr("同步名称到订单失败".$e->getMessage()); + } + } } \ No newline at end of file diff --git a/application/admin/service/PaymentOrderService.php b/application/admin/service/PaymentOrderService.php index 9435b5f..4d0c83f 100644 --- a/application/admin/service/PaymentOrderService.php +++ b/application/admin/service/PaymentOrderService.php @@ -30,6 +30,13 @@ class PaymentOrderService if (!$addRe['flag']) { return $addRe; } + if (!empty($param['id'])) { + $orderHotelModel = new OrderHotelDao(); + $orderHotelModel->updatePayOrderName($param['id'], $param["name"]); + + $orderItemModel = new OrderItemDao(); + $orderItemModel->updatePayOrderName($param['id'], $param["name"]); + } return Util::returnArrSu(); } diff --git a/application/admin/service/ReceiptOrderService.php b/application/admin/service/ReceiptOrderService.php index 8dcdced..fff34ee 100644 --- a/application/admin/service/ReceiptOrderService.php +++ b/application/admin/service/ReceiptOrderService.php @@ -29,6 +29,11 @@ class ReceiptOrderService if (!$addRe['flag']) { return $addRe; } + if (!empty($param['id'])) { + $orderModel = new OrderMainDao(); + $orderModel->updateReceiptOrderName($param['id'], $param["name"]); + } + return Util::returnArrSu(); }