From c5db9086036c986ac3a94098674830551d5e1763 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 1 Apr 2025 15:46:37 +0800 Subject: [PATCH] hook --- .../admin/controller/orders/Auditorder.php | 1 + .../admin/controller/orders/Configorder.php | 2 ++ .../admin/controller/orders/Dispatch2.php | 3 +-- application/admin/lang/zh-cn/order.php | 4 ++++ .../admin/lang/zh-cn/orders/auditorder.php | 6 ++++++ .../admin/lang/zh-cn/orders/configorder.php | 5 +++++ .../admin/lang/zh-cn/orders/dispatch2.php | 4 ++++ application/admin/model/Order.php | 19 +++++++++++++++++- application/admin/model/OrderDispatch.php | 5 +++++ .../admin/view/orders/auditorder/edit.html | 20 +++++++++++++++++-- .../admin/view/orders/configorder/edit.html | 7 +++++++ .../admin/view/orders/dispatch2/edit.html | 7 +++++++ public/assets/js/backend/orders/auditorder.js | 1 + .../assets/js/backend/orders/configorder.js | 2 ++ 14 files changed, 81 insertions(+), 5 deletions(-) diff --git a/application/admin/controller/orders/Auditorder.php b/application/admin/controller/orders/Auditorder.php index aca5b36..022f970 100644 --- a/application/admin/controller/orders/Auditorder.php +++ b/application/admin/controller/orders/Auditorder.php @@ -31,6 +31,7 @@ class Auditorder extends Backend $this->model = new \app\admin\model\Order(); //$this->view->assign("statusList", $this->model->getStatusList()); $this->view->assign("statusList", $this->model->getAuditStatusList()); + $this->view->assign("offlineTotalTypeList", $this->model->getOfflineTotalTypeList()); } diff --git a/application/admin/controller/orders/Configorder.php b/application/admin/controller/orders/Configorder.php index 54b54d3..5a14389 100644 --- a/application/admin/controller/orders/Configorder.php +++ b/application/admin/controller/orders/Configorder.php @@ -30,6 +30,8 @@ class Configorder extends Backend parent::_initialize(); $this->model = new Order(); $this->view->assign("statusList", $this->model->getStatusList()); + $this->view->assign("offlineTotalTypeList", $this->model->getOfflineTotalTypeList()); + } diff --git a/application/admin/controller/orders/Dispatch2.php b/application/admin/controller/orders/Dispatch2.php index 162df7c..d65d820 100644 --- a/application/admin/controller/orders/Dispatch2.php +++ b/application/admin/controller/orders/Dispatch2.php @@ -40,8 +40,7 @@ class Dispatch2 extends Backend $this->model = new \app\admin\model\OrderDispatch; $this->view->assign("typeList", $this->model->getTypeList()); $this->view->assign("statusList", $this->model->getStatusList()); - - + $this->view->assign("offlineTotalTypeList", $this->model->getOfflineTotalTypeList()); } diff --git a/application/admin/lang/zh-cn/order.php b/application/admin/lang/zh-cn/order.php index 4232711..bbd74eb 100644 --- a/application/admin/lang/zh-cn/order.php +++ b/application/admin/lang/zh-cn/order.php @@ -61,4 +61,8 @@ return [ 'Dispatch_time' => '派单时间', 'Delete_time' => '删除时间', 'Coupons' => '优惠', + 'Offline_amount_type' => '线下尾款类型', + 'Offline_amount_type 0' => '无', + 'Offline_amount_type 1' => '师傅收', + 'Offline_amount_type 2' => '公司收', ]; diff --git a/application/admin/lang/zh-cn/orders/auditorder.php b/application/admin/lang/zh-cn/orders/auditorder.php index c23df85..ce505ed 100644 --- a/application/admin/lang/zh-cn/orders/auditorder.php +++ b/application/admin/lang/zh-cn/orders/auditorder.php @@ -41,6 +41,12 @@ return [ 'Total' => '总收款', 'Online_amount' => '线上预付', 'Online_amount_last' => '线上尾款', + + 'Offline_amount_type' => '线下尾款类型', + 'Offline_amount_type 0' => '无', + 'Offline_amount_type 1' => '师傅收', + 'Offline_amount_type 2' => '公司收', + 'Offline_amount' => '线下尾款', 'Discount_amount' => '优惠抵扣', 'Real_amount' => '实际收款', diff --git a/application/admin/lang/zh-cn/orders/configorder.php b/application/admin/lang/zh-cn/orders/configorder.php index c565930..55166ab 100644 --- a/application/admin/lang/zh-cn/orders/configorder.php +++ b/application/admin/lang/zh-cn/orders/configorder.php @@ -42,6 +42,11 @@ return [ 'Online_amount' => '线上预付', 'Online_amount_last' => '线上尾款', 'Offline_amount' => '线下尾款', + + 'Offline_amount_type' => '线下尾款类型', + 'Offline_amount_type 0' => '无', + 'Offline_amount_type 1' => '师傅收', + 'Offline_amount_type 2' => '公司收', 'Discount_amount' => '优惠抵扣', 'Refund_amount' => '退款金额', 'Real_amount' => '实际收款', diff --git a/application/admin/lang/zh-cn/orders/dispatch2.php b/application/admin/lang/zh-cn/orders/dispatch2.php index 828346f..e95ea7d 100644 --- a/application/admin/lang/zh-cn/orders/dispatch2.php +++ b/application/admin/lang/zh-cn/orders/dispatch2.php @@ -30,6 +30,10 @@ return [ 'Total' => '线下尾款', 'Online' => '线上尾款', 'Amount' => '预计佣金', + 'Offline_total_type' => '线下尾款类型', + 'Offline_total_type 0' => '无', + 'Offline_total_type 1' => '师傅收', + 'Offline_total_type 2' => '公司收', 'Remark' => '备注', 'Notice_num' => '通知次数', 'Plan_time' => '预约时间', diff --git a/application/admin/model/Order.php b/application/admin/model/Order.php index 49e7437..6ccc972 100644 --- a/application/admin/model/Order.php +++ b/application/admin/model/Order.php @@ -30,7 +30,8 @@ class Order extends Model protected $append = [ 'status_text', 'collect_text', - 'dispatch_type_text' + 'dispatch_type_text', + 'offline_amount_type_text' ]; @@ -76,6 +77,12 @@ class Order extends Model } + public function getOfflineTotalTypeList() + { + return ['0' => __('Offline_amount_type 0'), '1'=> __('Offline_amount_type 1'),'2' => __('Offline_amount_type 2')]; + } + + public function getStatusTextAttr($value, $data) { $value = $value ?: ($data['status'] ?? ''); @@ -83,6 +90,16 @@ class Order extends Model return $list[$value] ?? ''; } + public function getOfflineAmountTypeTextAttr($value, $data) + { + $value = $value ?: ($data['offline_amount_type'] ?? ''); + $list = $this->getOfflineTotalTypeList(); + return $list[$value] ?? ''; + } + + + + public function getCollectTextAttr($value, $data) { diff --git a/application/admin/model/OrderDispatch.php b/application/admin/model/OrderDispatch.php index b4b073f..3207bcd 100644 --- a/application/admin/model/OrderDispatch.php +++ b/application/admin/model/OrderDispatch.php @@ -60,6 +60,11 @@ class OrderDispatch extends Model return ['0' => __('Is_notice 0'), '1' => __('Is_notice 1')]; } + public function getOfflineTotalTypeList() + { + return ['0' => __('Offline_total_type 0'), '1'=> __('Offline_total_type 1'),'2' => __('Offline_total_type 2')]; + } + public function getTypeTextAttr($value, $data) { diff --git a/application/admin/view/orders/auditorder/edit.html b/application/admin/view/orders/auditorder/edit.html index 5392f79..a1085aa 100644 --- a/application/admin/view/orders/auditorder/edit.html +++ b/application/admin/view/orders/auditorder/edit.html @@ -92,6 +92,14 @@ + +