From 0ff001879c24af849741854febf06d3681f566e9 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Fri, 4 Jul 2025 15:44:46 +0800 Subject: [PATCH 01/92] sth --- public/assets/js/backend/statistics/dispatcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/backend/statistics/dispatcher.js b/public/assets/js/backend/statistics/dispatcher.js index 23a6bec..ebc91cc 100644 --- a/public/assets/js/backend/statistics/dispatcher.js +++ b/public/assets/js/backend/statistics/dispatcher.js @@ -55,7 +55,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t {field: 'dispatch_admin_id', title: __('派单员'), searchList:$.getJSON("orders/configorder/getadminuser"),operate: 'IN',visible:false}, - {field: 'time_by', title: __('时间维度'), visible:false,searchList: {"1":__('录单时间'),"2":__('派单时间')},defaultValue:1, formatter: Table.api.formatter.normal}, + {field: 'time_by', title: __('时间维度'), visible:false,searchList: {"1":__('审核时间')},defaultValue:1, formatter: Table.api.formatter.normal}, {field: 'daterange', title: __('时间筛选'), addclass:'datetimerange', autocomplete:false, operate: "RANGE", From 7ab4a59a3b4bfda285dd7d633f2d968dc963da3c Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Fri, 4 Jul 2025 16:38:05 +0800 Subject: [PATCH 02/92] sth --- public/assets/js/require-table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index 3d8e940..2cc479d 100755 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table ignoreColumn: [0, 'operate'] //默认不导出第一列(checkbox)与操作(operate)列 }, pageSize: Config.pagesize || localStorage.getItem("pagesize") || 10, - pageList: [10, 15, 20, 25, 50, 'All'], + pageList: [10, 15, 20, 25, 50, 100], pagination: true, clickToSelect: true, //是否启用点击选中 dblClickToEdit: true, //是否启用双击编辑 From c6807fd9084cadb09254fc356a304bfabc475e77 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Fri, 4 Jul 2025 17:01:03 +0800 Subject: [PATCH 03/92] package --- public/assets/js/require-backend.min.js | 2 +- public/assets/js/require-frontend.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js index a5b537e..74fc902 100644 --- a/public/assets/js/require-backend.min.js +++ b/public/assets/js/require-backend.min.js @@ -11880,7 +11880,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr ignoreColumn: [0, 'operate'] //默认不导出第一列(checkbox)与操作(operate)列 }, pageSize: Config.pagesize || localStorage.getItem("pagesize") || 10, - pageList: [10, 15, 20, 25, 50, 'All'], + pageList: [10, 15, 20, 25, 50, 100], pagination: true, clickToSelect: true, //是否启用点击选中 dblClickToEdit: true, //是否启用双击编辑 diff --git a/public/assets/js/require-frontend.min.js b/public/assets/js/require-frontend.min.js index e908b94..19ea38c 100644 --- a/public/assets/js/require-frontend.min.js +++ b/public/assets/js/require-frontend.min.js @@ -11624,7 +11624,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr ignoreColumn: [0, 'operate'] //默认不导出第一列(checkbox)与操作(operate)列 }, pageSize: Config.pagesize || localStorage.getItem("pagesize") || 10, - pageList: [10, 15, 20, 25, 50, 'All'], + pageList: [10, 15, 20, 25, 50, 100], pagination: true, clickToSelect: true, //是否启用点击选中 dblClickToEdit: true, //是否启用双击编辑 From 56388198882ffefe0f649ee9644291f5b89c51ec Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Fri, 4 Jul 2025 22:24:09 +0800 Subject: [PATCH 04/92] =?UTF-8?q?=E8=AF=BB=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/orders/Configorder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/admin/controller/orders/Configorder.php b/application/admin/controller/orders/Configorder.php index 942ea8e..82890ce 100644 --- a/application/admin/controller/orders/Configorder.php +++ b/application/admin/controller/orders/Configorder.php @@ -118,7 +118,8 @@ class Configorder extends Backend } if (false === $this->request->isPost()) { $this->view->assign('row', $row); - $worker = Worker::where('id',$row->worker_id)->find(); + //$worker = Worker::where('id',$row->worker_id)->find(); + $worker = Worker::withTrashed()->where('id', $row->worker_id)->find(); $this->view->assign('worker', $worker); return $this->view->fetch(); } From a0840a0bacdd77f7cf4cd4b2609bace7cba92575 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Fri, 4 Jul 2025 22:27:52 +0800 Subject: [PATCH 05/92] =?UTF-8?q?=E8=AF=BB=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/orders/Auditorder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/admin/controller/orders/Auditorder.php b/application/admin/controller/orders/Auditorder.php index 2979194..b5b37f0 100644 --- a/application/admin/controller/orders/Auditorder.php +++ b/application/admin/controller/orders/Auditorder.php @@ -124,7 +124,8 @@ class Auditorder extends Backend if (false === $this->request->isPost()) { $order = Order::where('id',$ids)->find(); $this->view->assign('row', $row); - $this->view->assign('worker',Worker::where('id',$order->worker_id)->find()); + $worker = Worker::withTrashed()->where('id', $order->worker_id)->find(); + $this->view->assign('worker',$worker); $this->view->assign('cdnurl', config('upload.cdnurl')); return $this->view->fetch(); } From 8c86a46668320962a807efda524a02c86c112ed7 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:02:32 +0800 Subject: [PATCH 06/92] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/workers/worker/edit.html | 2 +- public/assets/js/backend/workers/worker.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/view/workers/worker/edit.html b/application/admin/view/workers/worker/edit.html index 5e4f07c..be446c3 100644 --- a/application/admin/view/workers/worker/edit.html +++ b/application/admin/view/workers/worker/edit.html @@ -95,7 +95,7 @@
- +
diff --git a/public/assets/js/backend/workers/worker.js b/public/assets/js/backend/workers/worker.js index 33845bf..0fa1f03 100644 --- a/public/assets/js/backend/workers/worker.js +++ b/public/assets/js/backend/workers/worker.js @@ -86,8 +86,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree','cascader'], }, visible: false }, { - field: '收款码', - title: __('Images'), + field: 'images', + title: __('收款码'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images From 7c826754599d7dea74e1a36b5c7e90555b4c72c4 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:02:51 +0800 Subject: [PATCH 07/92] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/workers/worker/add.html | 2 +- application/admin/view/workers/worker/edit.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/admin/view/workers/worker/add.html b/application/admin/view/workers/worker/add.html index 3848c40..d92a4d3 100644 --- a/application/admin/view/workers/worker/add.html +++ b/application/admin/view/workers/worker/add.html @@ -75,7 +75,7 @@
- +
diff --git a/application/admin/view/workers/worker/edit.html b/application/admin/view/workers/worker/edit.html index be446c3..6338a36 100644 --- a/application/admin/view/workers/worker/edit.html +++ b/application/admin/view/workers/worker/edit.html @@ -92,7 +92,7 @@
- +
From 17f1c4edbf13f3d9fd3e57ffd23471cca3025922 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:11:09 +0800 Subject: [PATCH 08/92] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/backend/order.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js index 5ff7b6c..93a3e62 100644 --- a/public/assets/js/backend/order.js +++ b/public/assets/js/backend/order.js @@ -146,7 +146,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'} }, operate: '=', }, - {field: 'dispatch_admin_user', title: '派单员',operate: 'LIKE'}, + {field: 'customer', title: __('Customer'), operate: 'LIKE'}, { field: 'dispatch_type', title: '派单方式', @@ -160,7 +160,8 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'} {field: 'user.nickname', title: '录单员',operate: 'LIKE'}, - {field: 'customer', title: __('Customer'), operate: 'LIKE'}, + {field: 'dispatch_admin_user', title: '派单员',operate: 'LIKE'}, + {field: 'tel', title: __('Tel'), operate: 'LIKE'}, {field: 'area.merge_name', title: __('Area_id'), searchable: false}, { From 02a60399af61123f90e58172b8c1ce213d3b6a7d Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:18:52 +0800 Subject: [PATCH 09/92] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/view/orders/configorder/edit.html | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/application/admin/view/orders/configorder/edit.html b/application/admin/view/orders/configorder/edit.html index f2e88b3..1ff23a2 100644 --- a/application/admin/view/orders/configorder/edit.html +++ b/application/admin/view/orders/configorder/edit.html @@ -18,7 +18,7 @@
-
+ @@ -51,11 +51,12 @@
- +
+ {if condition='$row.status eq 40'}
@@ -97,12 +98,12 @@
-
+
@@ -195,12 +196,12 @@
-
- -
- -
-
+ + + + + +
From fa04c4b031e41eff62f6c70d442eda92a26f7fad Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:20:53 +0800 Subject: [PATCH 10/92] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/orders/configorder/edit.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/view/orders/configorder/edit.html b/application/admin/view/orders/configorder/edit.html index 1ff23a2..1807f80 100644 --- a/application/admin/view/orders/configorder/edit.html +++ b/application/admin/view/orders/configorder/edit.html @@ -51,7 +51,7 @@
- +
@@ -83,7 +83,7 @@
- +
@@ -182,7 +182,7 @@
- +
From ccdc93c75cf48ecd43081b2cf9e6028870813aa7 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:31:07 +0800 Subject: [PATCH 11/92] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/view/orders/review/edit.html | 62 ++++++++++++++++++- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/application/admin/view/orders/review/edit.html b/application/admin/view/orders/review/edit.html index 353cf3a..f781b02 100644 --- a/application/admin/view/orders/review/edit.html +++ b/application/admin/view/orders/review/edit.html @@ -10,7 +10,6 @@
-
@@ -33,13 +32,70 @@
- +
- +
+ {if condition='$row.status eq 60'} + + +
+ +
+ +
+
+ + +
+ +
+ {:build_select('row[offline_amount_type]',$offlineTotalTypeList,$row['offline_amount_type'],['class'=>'form-control readonly','data-rule'=>'required'])} +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + + {/if} + + + + + + {if condition='$row.status eq -10'} +
+ +
+ +
+
+ + {/if} + {if condition='$row.cancel_detail neq ""'} From 19b9d6a510f0d452217c32e357bac5eadb3a1002 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:31:53 +0800 Subject: [PATCH 12/92] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/orders/review/edit.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/view/orders/review/edit.html b/application/admin/view/orders/review/edit.html index f781b02..583fbd6 100644 --- a/application/admin/view/orders/review/edit.html +++ b/application/admin/view/orders/review/edit.html @@ -43,7 +43,7 @@
- +
@@ -51,7 +51,7 @@
- +
{:build_select('row[offline_amount_type]',$offlineTotalTypeList,$row['offline_amount_type'],['class'=>'form-control readonly','data-rule'=>'required'])}
@@ -59,7 +59,7 @@
- +
From d8490ae2a39188a597f4f59e28d4fe5e468f4030 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:37:07 +0800 Subject: [PATCH 13/92] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Orderplan.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/controller/Orderplan.php b/application/admin/controller/Orderplan.php index 97444e1..5b63e29 100644 --- a/application/admin/controller/Orderplan.php +++ b/application/admin/controller/Orderplan.php @@ -139,7 +139,7 @@ class Orderplan extends Backend 'sum(performance) performance' ]) ->where('status',\app\admin\model\Order::STATUS_FINISHED) - ->group(' DATE(create_time)'); + ->group(' DATE(audit_time)'); $res = $this->buildDate($build)->select(); $data = []; From 15e80a39eaefbaf73157ac1626149e9ca419b482 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:39:01 +0800 Subject: [PATCH 14/92] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Orderplan.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/controller/Orderplan.php b/application/admin/controller/Orderplan.php index 5b63e29..4f76059 100644 --- a/application/admin/controller/Orderplan.php +++ b/application/admin/controller/Orderplan.php @@ -133,7 +133,7 @@ class Orderplan extends Backend } $build->field([ - 'DATE(create_time) day', + 'DATE(audit_time) day', 'sum(total) total', 'count(id) count', 'sum(performance) performance' From 5fdc8c20003632fbf6c571d23d81ceb8a154faaa Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:42:30 +0800 Subject: [PATCH 15/92] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Orderplan.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/Orderplan.php b/application/admin/controller/Orderplan.php index 4f76059..658442f 100644 --- a/application/admin/controller/Orderplan.php +++ b/application/admin/controller/Orderplan.php @@ -300,17 +300,26 @@ class Orderplan extends Backend $start = now()->format('Y-m-d 00:00:00'); $end_at = now()->format('Y-m-d 23:59:59'); + $build = new \app\admin\model\Order(); + $build->whereBetween('audit_time', [$start, $end_at]) + ->where('status',\app\admin\model\Order::STATUS_FINISHED); + $data1 = $build->field([ + 'sum(total) total', + 'count(*) count', + ])->select(); + + $build = new \app\admin\model\Order(); $build->whereBetween('create_time', [$start, $end_at]); $data = $build->field([ - 'sum(total) total', - 'count(id) count', + /* 'sum(total) total', + 'count(id) count',*/ 'count(if(status=-10,1,null)) cancel' ])->select(); $today = [ - 'total' => $data[0]->total ?? 0, - 'count' => $data[0]->count ?? 0, + 'total' => $data1[0]->total ?? 0, + 'count' => $data1[0]->count ?? 0, 'cancel' => $data[0]->cancel ?? 0, ]; From 4d2b9074a57fcbb9be8cdc5c87439b8549caff5a Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 14:59:15 +0800 Subject: [PATCH 16/92] tts --- application/admin/behavior/OrderDispatchLog.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/admin/behavior/OrderDispatchLog.php b/application/admin/behavior/OrderDispatchLog.php index 9708c55..b152f5a 100644 --- a/application/admin/behavior/OrderDispatchLog.php +++ b/application/admin/behavior/OrderDispatchLog.php @@ -48,7 +48,8 @@ class OrderDispatchLog 'type' => 1, 'outid' => md5(time().rand(1000,9999).rand(1000,9999)), 'create_time' => date('Y-m-d H:i:s'), - 'status' => $alibaba_dyvms['sync']?1:0 + 'status' => $alibaba_dyvms['sync']?1:0, + 'mobile' => $dispatch->worker_tel, ]; $service = new NoticeLogic(); $service->dispatchNotice($dispatch); From b28deda70e35883399bc99d1ec826209f67d130b Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 15:13:40 +0800 Subject: [PATCH 17/92] tts --- application/admin/controller/Order.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index d395d67..2043a86 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -620,14 +620,16 @@ class Order extends Backend 'update_time' => now()->format('Y-m-d H:m:s'), ]; + $orderDispatch = OrderDispatch::where('order_id',$order->id)->whereBetween('status','>=',0)->find(); if ($params['abnormal_id'] == 2 || $params['abnormal_id'] == 3) { $order->status = \app\admin\model\Order::STATUS_CANCEL; $order->save(); - if (!empty($order->dispatch->id)) { + + if (!empty($orderDispatch)) { $orderLogic = new OrderLogic(); - $orderLogic->cancelOrderDispatch($order->dispatch, $this->auth, '订单被取消', false); + $orderLogic->cancelOrderDispatch($orderDispatch, $this->auth, '订单被取消', false); //日志 $hookparams['order'] = $order; $hookparams['role'] = 1; @@ -647,9 +649,9 @@ class Order extends Backend $order->status = \app\admin\model\Order::STATUS_DISPATCHING; $order->save(); - if (!empty($order->dispatch->id)) { + if (!empty($orderDispatch)) { $OrderLogic = new OrderLogic(); - $OrderLogic->noWorkerCanGetIt($order->dispatch, '系统取消' . $abnormal_title); + $OrderLogic->noWorkerCanGetIt($orderDispatch, '系统取消' . $abnormal_title); AutoDispatchLogic::autoDispatch($order); } @@ -672,7 +674,6 @@ class Order extends Backend $result = \model('order_abnormal')->insert($insert); Db::commit(); } catch (ValidateException|PDOException|Exception $e) { - throw $e; Db::rollback(); $this->error($e->getMessage()); } From 67fa2b76979b173c657205a3de834f902ea62379 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 15:31:59 +0800 Subject: [PATCH 18/92] tts --- .../admin/controller/statistics/Item.php | 38 +++++++++++++++++-- .../admin/view/statistics/item/index.html | 8 ++++ public/assets/js/backend/statistics/item.js | 2 + 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/application/admin/controller/statistics/Item.php b/application/admin/controller/statistics/Item.php index ec424fa..3e50c83 100644 --- a/application/admin/controller/statistics/Item.php +++ b/application/admin/controller/statistics/Item.php @@ -10,6 +10,7 @@ use app\admin\model\OrderReview; use app\common\controller\Backend; use PDOStatement; use think\Collection; +use think\Db; use think\Exception; use think\exception\DbException; use think\Loader; @@ -33,6 +34,29 @@ class Item extends Backend public function _initialize() { parent::_initialize(); + + $sources = Db::name('source') + ->where('status', 1) + ->field(['id', 'title', 'key_word', 'pid']) + ->order('pid', 'asc') + ->order('sort', 'desc') + ->select(); + $filtered = array_filter($sources, function ($item) { + return $item['pid'] == 0; + }); + + $pid_map = array_column($filtered, null, 'id'); + $res = []; + foreach ($sources as $item) { + if ($item['pid'] != 0 && isset($pid_map[$item['pid']])) { + $res [] = [ + ...$item, 'ptitle' => $pid_map[$item['pid']]['title'] + ]; + } + } + $this->view->assign("sources", $res); + + } public function index() @@ -139,6 +163,8 @@ class Item extends Backend $filter ['daterange'] = request()->post('daterange'); + + if (!empty($filter['daterange'])) { $arr = explode(' - ', $filter['daterange']); if (trim($arr[0])) { @@ -149,9 +175,15 @@ class Item extends Backend } } - $res = $build - ->whereBetween('create_time', [$start, $end_at]) - ->field([ + $build = $build + ->whereBetween('create_time', [$start, $end_at]); + + if(!empty(request()->post('source',null))){ + $build->where('source',request()->post('source')); + } + + + $res = $build->field([ 'item_title name', // 类型 'sum(total) total', // 营业额 'count(id) count', // 单量 diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index d97d0e4..6fbc48f 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -29,6 +29,14 @@
+
+ +
+
diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index f31db4a..5036202 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -187,10 +187,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t getChartData: function () { // 获取日期范围值 var daterange = $('#daterange').val(); + var source = $('#source').val(); // 构建查询参数 var params = { 'daterange': daterange, + 'source': source }; $.ajax({ From e2c2ea00860e624ed880665c9481ad1a235f17a8 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 15:44:02 +0800 Subject: [PATCH 19/92] tts --- .../admin/controller/statistics/Item.php | 5 +++++ .../admin/view/statistics/item/index.html | 9 +++++++++ public/assets/js/backend/statistics/item.js | 18 ++++++++++++++++-- public/assets/js/backend/statistics/worker.js | 3 +-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/statistics/Item.php b/application/admin/controller/statistics/Item.php index 3e50c83..08f9736 100644 --- a/application/admin/controller/statistics/Item.php +++ b/application/admin/controller/statistics/Item.php @@ -178,10 +178,15 @@ class Item extends Backend $build = $build ->whereBetween('create_time', [$start, $end_at]); + //来源 if(!empty(request()->post('source',null))){ $build->where('source',request()->post('source')); } + //城市 + if(!empty(request()->post('area_id',null))){ + $build->where('area_id','LIKE',request()->post('source').'%'); + } $res = $build->field([ 'item_title name', // 类型 diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 6fbc48f..4881a88 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -37,6 +37,15 @@
+ +
+
+ + +
+
+ +
diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index 5036202..7e3daaf 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -88,6 +88,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t url:'statistics/item/list?' + data, }); }); + + + $("#select_city").on("cp:updated", function () { + console.log(123); + var citypicker = $(this).data("citypicker"); + var code = citypicker.getCode("district") || citypicker.getCode("city") || citypicker.getCode("province"); + $("#select_area_id").val(code); + }); }, add: function () { @@ -188,11 +196,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t // 获取日期范围值 var daterange = $('#daterange').val(); var source = $('#source').val(); + var city_id = $('#area_id').val(); + var item_id = $('#item_id').val(); // 构建查询参数 var params = { 'daterange': daterange, - 'source': source + 'source': source, + 'area_id': city_id, }; $.ajax({ @@ -207,7 +218,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t console.error("图表数据加载失败"); } }); - } + }, + + + } }; return Controller; diff --git a/public/assets/js/backend/statistics/worker.js b/public/assets/js/backend/statistics/worker.js index e6b175a..420d975 100644 --- a/public/assets/js/backend/statistics/worker.js +++ b/public/assets/js/backend/statistics/worker.js @@ -83,8 +83,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t visible: false }, - {field: 'item_id', title: __('工程'), searchList:$.getJSON("ajax/getItems"),operate: 'IN',visible:false}, - + {field: 'item_id', title: __('工种'), searchList:$.getJSON("ajax/getItems"),operate: 'IN',visible:false}, {field: 'operate', title: __('Operate'), table: table2, events: Table.api.events.operate, formatter: Table.api.formatter.operate, buttons: [ From e08dc78904986e8dffaa34d5ef42645cfffc7b5b Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:05:27 +0800 Subject: [PATCH 20/92] tts --- .../admin/controller/statistics/Item.php | 25 +++++++++++++++++-- .../admin/view/statistics/item/index.html | 11 ++++++++ public/assets/js/backend/statistics/item.js | 13 ++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/statistics/Item.php b/application/admin/controller/statistics/Item.php index 08f9736..d5ba0e4 100644 --- a/application/admin/controller/statistics/Item.php +++ b/application/admin/controller/statistics/Item.php @@ -25,7 +25,7 @@ use function Symfony\Component\Clock\now; */ class Item extends Backend { - + protected $itemsformattedTree = null; protected $noNeedRight = ['list','chartData']; @@ -54,8 +54,21 @@ class Item extends Backend ]; } } - $this->view->assign("sources", $res); + $items = Db::name('item') + ->where('status', 1) + ->field(['id', 'title', 'key_word', 'pid']) + ->order('pid', 'asc') + ->order('sort', 'desc') + ->select(); + $tree = $this->buildTree($items); + $formattedTree = $this->formatTree($tree); + + $this->items = $items; + $this->itemsformattedTree = $formattedTree; + + $this->view->assign("sources", $res); + $this->view->assign("items", $formattedTree); } @@ -188,6 +201,14 @@ class Item extends Backend $build->where('area_id','LIKE',request()->post('source').'%'); } + if(!empty(request()->post('item_id',null))){ + $item_id =request()->post('item_id'); + $item_ids = $this->getItemsById($item_id); + $item_ids [] = $item_id; + $build->whereIn('item_id', $item_ids); + } + + $res = $build->field([ 'item_title name', // 类型 'sum(total) total', // 营业额 diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 4881a88..da9d918 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -46,6 +46,14 @@
+
+
+ + +
+
+ +
@@ -79,3 +87,6 @@
+ diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index 7e3daaf..7b8cca5 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -96,6 +96,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t var code = citypicker.getCode("district") || citypicker.getCode("city") || citypicker.getCode("province"); $("#select_area_id").val(code); }); + + var _data = items; + $('#select_item').zdCascader({ + data: _data, + onChange: function ($this, data, allPathData) { + // console.log(data,allPathData); + $('#select_item_id').val(data.value); + }, + clear: true, + clickParent: true + }); + }, add: function () { @@ -204,6 +216,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t 'daterange': daterange, 'source': source, 'area_id': city_id, + 'item_id': item_id, }; $.ajax({ From b89642b2b981d137a090f974f9645ef85b41d4d6 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:18:15 +0800 Subject: [PATCH 21/92] tts --- .../admin/controller/statistics/Item.php | 15 ++++++++++++ .../admin/view/statistics/item/index.html | 23 +++++++++++++++++-- public/assets/js/backend/statistics/item.js | 21 +++++++++++++---- 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/application/admin/controller/statistics/Item.php b/application/admin/controller/statistics/Item.php index d5ba0e4..6084985 100644 --- a/application/admin/controller/statistics/Item.php +++ b/application/admin/controller/statistics/Item.php @@ -106,6 +106,21 @@ class Item extends Backend $build->where('area_id', 'like', $area_id . '%'); } + //来源 + if(!empty(request()->get('source',null))){ + $build->where('source',request()->get('source')); + } + //城市 + /* if(!empty(request()->post('area_id',null))){ + $build->where('area_id','LIKE',request()->post('source').'%'); + }*/ + + if(!empty(request()->get('item_id',null))){ + $item_id =request()->get('item_id'); + $item_ids = $this->getItemsById($item_id); + $item_ids [] = $item_id; + $build->whereIn('item_id', $item_ids); + } $build->whereBetween('create_time', [$start, $end_at]) ->field([ diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index da9d918..a1a97d1 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -29,7 +29,7 @@
-
+ @@ -69,15 +69,34 @@
+ +
+ +
+
+ +
+
+ + +
+
+
+ +
diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index 7b8cca5..e69f912 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -76,6 +76,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t const area_id = $('#area_id').val(); const range = $('#daterange-table').val(); + + const source1 = $('#source').val(); + var item_id = $('#item_id').val(); + + let data = ''; if (area_id !== ''){ data += 'area_id=' + area_id+'&'; @@ -83,6 +88,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t if (range !== ''){ data += 'range=' + range; } + + if (source1!== ''){ + data += 'source=' + source1; + } + if (item_id !== ''){ + data +='item_id=' + item_id; + } + // data = encodeURIComponent(data); $("#table2").bootstrapTable('refresh',{ url:'statistics/item/list?' + data, @@ -207,16 +220,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t getChartData: function () { // 获取日期范围值 var daterange = $('#daterange').val(); - var source = $('#source').val(); + /* var source = $('#source').val(); var city_id = $('#area_id').val(); var item_id = $('#item_id').val(); - +*/ // 构建查询参数 var params = { 'daterange': daterange, - 'source': source, + /* 'source': source, 'area_id': city_id, - 'item_id': item_id, + 'item_id': item_id,*/ }; $.ajax({ From 77766054168b7fb7c801ce9bc1373a4c5349d357 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:18:52 +0800 Subject: [PATCH 22/92] tts --- application/admin/view/statistics/item/index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index a1a97d1..2efdbe5 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -70,7 +70,13 @@
+
+ + +
+ +
-
- - -
-
@@ -95,7 +96,7 @@ value = "{$default_daterange}" placeholder="指定日期" name="filter[daterange]" id="daterange-table" autocomplete="off" style="width: 180px;">
- + From 63af0c7ae390ebc62fd7c07d5409843d34e78dbf Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:23:00 +0800 Subject: [PATCH 23/92] tts --- application/admin/view/orders/auditorder/edit.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/admin/view/orders/auditorder/edit.html b/application/admin/view/orders/auditorder/edit.html index e51e1b5..d3596fd 100755 --- a/application/admin/view/orders/auditorder/edit.html +++ b/application/admin/view/orders/auditorder/edit.html @@ -16,12 +16,12 @@
-
+
From a38417912b3cb016c73e968a08cf0152c0c4a5b5 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:24:29 +0800 Subject: [PATCH 24/92] tts --- application/admin/view/orders/auditorder/edit.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/view/orders/auditorder/edit.html b/application/admin/view/orders/auditorder/edit.html index d3596fd..8449c99 100755 --- a/application/admin/view/orders/auditorder/edit.html +++ b/application/admin/view/orders/auditorder/edit.html @@ -78,7 +78,7 @@
- +
@@ -171,7 +171,7 @@
- +
@@ -187,7 +187,7 @@
- +
From c9d7f9d6d76ad80d4ca7f09e66cddaa8edef3198 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:31:50 +0800 Subject: [PATCH 25/92] tts --- application/admin/view/statistics/item/index.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 2efdbe5..fd9f900 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -68,30 +68,31 @@
-
+
-
+
-
+
-
+
-
+
From ebefe0fe3814d94e98b31ea6df9ae4459837a47a Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:38:07 +0800 Subject: [PATCH 26/92] tts --- .../admin/view/statistics/item/index.html | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index fd9f900..2a39315 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -68,39 +68,46 @@
-
+
- -
- - + +
+ +
-
+ +
-
-
- - -
+ +
+ +
-
- + +
+
- - +
+ +
+
From 5be068b6d3ab161c3c3e63549993cb05e4565ca3 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:41:57 +0800 Subject: [PATCH 27/92] tts --- application/admin/view/statistics/item/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 2a39315..facebed 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -71,15 +71,15 @@
-
- +
+
- + {foreach $sources as $item} {/foreach} @@ -88,7 +88,7 @@
- +
From 9598ae9c7fa462c58023c84cfea8cdf08ba60cdc Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:42:42 +0800 Subject: [PATCH 28/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index facebed..2c5da06 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -68,7 +68,7 @@
-
+
From eab9473e4bae7abc6ae19f59d78a630147e45eae Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 16:46:38 +0800 Subject: [PATCH 29/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 2c5da06..b0826fe 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -72,7 +72,7 @@
- +
From 550bb70d87313014f7ce2d46719605ddc8ebdfd4 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:24:12 +0800 Subject: [PATCH 30/92] tts --- public/assets/js/backend/statistics/item.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index e69f912..a1577bd 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -74,7 +74,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t $('#filter-btn-table').on('click', function () { - const area_id = $('#area_id').val(); + const area_id = $('#select_area_id').val(); const range = $('#daterange-table').val(); const source1 = $('#source').val(); @@ -82,7 +82,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t let data = ''; - if (area_id !== ''){ + if (area_id !== '' ){ data += 'area_id=' + area_id+'&'; } if (range !== ''){ @@ -107,6 +107,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t console.log(123); var citypicker = $(this).data("citypicker"); var code = citypicker.getCode("district") || citypicker.getCode("city") || citypicker.getCode("province"); + console.log(code); $("#select_area_id").val(code); }); From 7f4dbdeda9d8595d896100da3609738030a7dd15 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:26:39 +0800 Subject: [PATCH 31/92] tts --- public/assets/js/backend/statistics/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index a1577bd..906f947 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-theme', 'template', 'addtabs', 'moment','citypicker'], function ($, undefined, Backend, Table, Form, echarts, undefined, Template, Datatable, Moment) { +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'cascader','echarts-theme', 'template', 'addtabs', 'moment','citypicker'], function ($, undefined, Backend, Table, Form, echarts, undefined, Template, Datatable, Moment) { var Controller = { From f90caa48a7759f88fe645ec702e1fd587e2208ef Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:31:29 +0800 Subject: [PATCH 32/92] tts --- public/assets/js/backend/statistics/item.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index 906f947..5b04605 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -1,5 +1,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'cascader','echarts-theme', 'template', 'addtabs', 'moment','citypicker'], function ($, undefined, Backend, Table, Form, echarts, undefined, Template, Datatable, Moment) { + var Controller = { index: function () { From 7b97a4c478c97f4fe08a13cd1e42fb746a80b0de Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:41:20 +0800 Subject: [PATCH 33/92] tts --- public/assets/js/backend/statistics/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index 5b04605..cc66487 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'cascader','echarts-theme', 'template', 'addtabs', 'moment','citypicker'], function ($, undefined, Backend, Table, Form, echarts, undefined, Template, Datatable, Moment) { +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-theme', 'template', 'addtabs', 'moment','citypicker'], function ($, undefined, Backend, Table, Form, echarts, undefined, Template, Datatable, Moment) { var Controller = { From 33dc5868b4e3fbf61845b3e198bb27826680e70f Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:42:37 +0800 Subject: [PATCH 34/92] tts --- public/assets/js/backend/statistics/item.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index cc66487..15bb479 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -87,14 +87,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th data += 'area_id=' + area_id+'&'; } if (range !== ''){ - data += 'range=' + range; + data += 'range=' + range+'&'; } if (source1!== ''){ - data += 'source=' + source1; + data += 'source=' + source1+'&'; } if (item_id !== ''){ - data +='item_id=' + item_id; + data +='item_id=' + item_id+'&'; } // data = encodeURIComponent(data); From 8e9ec8cb8b8d0dd73dbdfbb7eb454bb07cab5326 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:42:58 +0800 Subject: [PATCH 35/92] tts --- public/assets/js/backend/statistics/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index 15bb479..ac5db4b 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -94,7 +94,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th data += 'source=' + source1+'&'; } if (item_id !== ''){ - data +='item_id=' + item_id+'&'; + data +='item_id=' + item_id; } // data = encodeURIComponent(data); From 98061212702dfa188b7801edf9fb5949e5c29f61 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:44:49 +0800 Subject: [PATCH 36/92] tts --- public/assets/js/backend/statistics/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index ac5db4b..e3a1ebe 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -93,7 +93,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th if (source1!== ''){ data += 'source=' + source1+'&'; } - if (item_id !== ''){ + if (item_id !== '' && item_id !== 'undefined'){ data +='item_id=' + item_id; } From 807f785c657cddf41b829164b7c842d1059b4358 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:45:23 +0800 Subject: [PATCH 37/92] tts --- public/assets/js/backend/statistics/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index e3a1ebe..1fcdea0 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -79,7 +79,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th const range = $('#daterange-table').val(); const source1 = $('#source').val(); - var item_id = $('#item_id').val(); + var item_id = $('#select_item_id').val(); let data = ''; From 7e10bb3d8b65cf1ea7287f3332926e936028c126 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:52:47 +0800 Subject: [PATCH 38/92] tts --- public/assets/js/backend/statistics/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index 1fcdea0..f6f7cde 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-theme', 'template', 'addtabs', 'moment','citypicker'], function ($, undefined, Backend, Table, Form, echarts, undefined, Template, Datatable, Moment) { +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-theme', 'template', 'addtabs', 'moment','citypicker','cascader'], function ($, undefined, Backend, Table, Form, echarts, undefined, Template, Datatable, Moment) { var Controller = { From ebeea6e904a0626ac5164a5584f37593f00cf7c2 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 7 Jul 2025 19:55:51 +0800 Subject: [PATCH 39/92] tts --- application/admin/view/statistics/item/index.html | 4 ++-- public/assets/js/backend/statistics/item.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index b0826fe..be74b8d 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -87,10 +87,10 @@
-
+
diff --git a/public/assets/js/backend/statistics/item.js b/public/assets/js/backend/statistics/item.js index f6f7cde..5192a54 100644 --- a/public/assets/js/backend/statistics/item.js +++ b/public/assets/js/backend/statistics/item.js @@ -112,7 +112,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th $("#select_area_id").val(code); }); - var _data = items; + /* var _data = items; $('#select_item').zdCascader({ data: _data, onChange: function ($this, data, allPathData) { @@ -121,7 +121,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th }, clear: true, clickParent: true - }); + });*/ }, From 419a31951474a98f79205572d1ea214b4e856b96 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 09:38:19 +0800 Subject: [PATCH 40/92] tts --- application/admin/view/statistics/item/index.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index be74b8d..cb31b4e 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -1,3 +1,12 @@ + +
- +
@@ -225,29 +228,31 @@
- -
- -
- -
-
+ -
- -
-
- -
- - -
- + {/if} From 0a05797b4c59ce075aec1410b2a0f6384aab0399 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:36:28 +0800 Subject: [PATCH 61/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index f693a2f..1e9cf46 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -69,7 +69,7 @@ -
+
From 177674774dcf1eefcf08791ec541f885ab415e36 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:40:40 +0800 Subject: [PATCH 62/92] tts --- application/admin/view/statistics/item/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 1e9cf46..d502f94 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -15,6 +15,13 @@ border: 1px solid #ccc; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } + + #select_city { + height: 34px; /* Bootstrap 默认输入框高度 */ + line-height: 34px; /* 让文字垂直居中 */ + padding-top: 0; + padding-bottom: 0; + }
From 197b57506d8aa953ad3d6a14d150681f602e310f Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:41:48 +0800 Subject: [PATCH 63/92] tts --- application/admin/view/statistics/item/index.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index d502f94..dc1f3be 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -17,10 +17,15 @@ } #select_city { - height: 34px; /* Bootstrap 默认输入框高度 */ - line-height: 34px; /* 让文字垂直居中 */ - padding-top: 0; - padding-bottom: 0; + height: 34px !important; /* 标准输入框高度 */ + line-height: 34px !important; /* 文字垂直居中 */ + padding: 6px 12px !important; /* bootstrap默认内边距 */ + box-sizing: border-box !important; + font-size: 14px !important; + display: block !important; + vertical-align: middle !important; + overflow: hidden !important; + white-space: nowrap !important; } From bb3a8dc0185222d8667af41acb52fc0250624d33 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:42:57 +0800 Subject: [PATCH 64/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index dc1f3be..75eafd4 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -81,7 +81,7 @@ -
+
From 52532cbaaeb7f1cbae06b91e18a3c19473197248 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:43:59 +0800 Subject: [PATCH 65/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 75eafd4..8e27d65 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -81,7 +81,7 @@ -
+
From f04351d19cf4cb55e98ea61f033a2fdba3158b0c Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:44:35 +0800 Subject: [PATCH 66/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 8e27d65..9028647 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -81,7 +81,7 @@ -
+
From 0430a035d5403b51f0011436da9b882cf89dad74 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:44:55 +0800 Subject: [PATCH 67/92] tts --- application/admin/view/statistics/item/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 9028647..855d957 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -87,7 +87,7 @@
-
+
{foreach $items as $item} @@ -108,7 +108,7 @@ -
+
Date: Tue, 8 Jul 2025 10:46:35 +0800 Subject: [PATCH 68/92] tts --- .../admin/view/statistics/item/index.html | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 855d957..8c8d7da 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -1,33 +1,3 @@ -
From 86aee60978df7b026526843d964c423b73e79872 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 10:47:33 +0800 Subject: [PATCH 69/92] tts --- application/admin/view/statistics/item/index.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 8c8d7da..b0ee3a3 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -100,6 +100,3 @@
- From 325c849cd8ad0c64b91947ba95f05247df4aa289 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 11:15:33 +0800 Subject: [PATCH 70/92] tts --- .../admin/view/statistics/item/index.html | 45 +++++++++++++++---- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index b0ee3a3..af0304c 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -1,3 +1,32 @@ + +
@@ -47,17 +76,16 @@
-
+
- - -
+ +
-
+
- -
+ +
- -
+
Date: Tue, 8 Jul 2025 11:16:22 +0800 Subject: [PATCH 71/92] tts --- .../admin/view/statistics/item/index.html | 45 ++++--------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index af0304c..28702fe 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -1,32 +1,3 @@ - -
@@ -76,16 +47,17 @@
-
+
- -
+ + +
-
+
- -
+ +
+ -
+
Date: Tue, 8 Jul 2025 11:19:40 +0800 Subject: [PATCH 72/92] tts --- .../admin/view/statistics/item/index.html | 55 +++++++++++++------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 28702fe..01efda9 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -1,3 +1,33 @@ + +
@@ -47,17 +77,15 @@
-
- - - -
+
+ +
-
+
- -
+ +
- -
+
- -
- -
- -
- +
From 1b1ab95994806cc4e8fe1cdff70265f04e07b9f8 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 11:22:03 +0800 Subject: [PATCH 73/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 01efda9..486ff4f 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -9,7 +9,7 @@ /* 城市选择的容器,定位弹层基准 */ #select_city_wrapper { position: relative; /* 弹层相对定位 */ - width: 300px; + width: 250px; display: inline-block; } From 9db67da1eccf564fdfd89fa4f239b1805afac9f0 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 11:23:11 +0800 Subject: [PATCH 74/92] tts --- application/admin/view/statistics/item/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index 486ff4f..b18650a 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -80,7 +80,7 @@
- +
From 21c422a9fee081f2c1c267463ca1915a32e0c43b Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 8 Jul 2025 13:59:44 +0800 Subject: [PATCH 75/92] tts --- .../admin/view/statistics/item/index.html | 74 ++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/application/admin/view/statistics/item/index.html b/application/admin/view/statistics/item/index.html index b18650a..7d86ea6 100644 --- a/application/admin/view/statistics/item/index.html +++ b/application/admin/view/statistics/item/index.html @@ -77,42 +77,48 @@
-
- -
- - -
+
+ +
+ + +
- -
- -
+ +
+ +
- -
- -
+ +
+ +
- -
- + +
+ +
+ + +
+ +
@@ -121,3 +127,5 @@ + + From 056e0ce2d3c38aff2cf04bd6e30830d6ffaaef36 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 10:49:14 +0800 Subject: [PATCH 76/92] tts --- application/admin/controller/orders/Configorder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/admin/controller/orders/Configorder.php b/application/admin/controller/orders/Configorder.php index 82890ce..0dcc945 100644 --- a/application/admin/controller/orders/Configorder.php +++ b/application/admin/controller/orders/Configorder.php @@ -144,6 +144,7 @@ class Configorder extends Backend $data = [ 'status' => Order::STATUS_AUDITING, + 'online_amount' => $params['online_amount'], 'online_amount_last' => $params['online_amount_last'], 'offline_amount' => $params['offline_amount'], // 'refund_amount' => $params['refund_amount'], @@ -161,7 +162,7 @@ class Configorder extends Backend $cost = bcadd($params['cost'],$params['material_cost'],2); - $data['total'] = bcadd($row->online_amount,$last_amount,2); + $data['total'] = bcadd($params['online_amount'],$last_amount,2); $data['real_amount'] = $data['total']; $data['performance'] = bcsub($data['real_amount'],$cost,2); $result = $row->allowField(true)->save($data); From e8de8d5bb82751e8208903d9ff88ec3479e911d8 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 13:49:56 +0800 Subject: [PATCH 77/92] tts --- .../admin/controller/orders/Dispatch2.php | 3 +- .../admin/view/orders/dispatch2/edit.html | 35 ++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/application/admin/controller/orders/Dispatch2.php b/application/admin/controller/orders/Dispatch2.php index ecd1363..840e4b2 100644 --- a/application/admin/controller/orders/Dispatch2.php +++ b/application/admin/controller/orders/Dispatch2.php @@ -323,6 +323,7 @@ class Dispatch2 extends Backend //计算价格 $data = [ + 'online_amount' => $orderParsms['online_amount'], //线上尾款 'online_amount_last' => $row->online_total, //线上尾款 'offline_amount' => $row->total, //线下尾款 'cost' => $orderParsms['cost'], @@ -340,7 +341,7 @@ class Dispatch2 extends Backend $cost = bcadd($data['cost'],$data['material_cost'],2); - $data['total'] = bcadd($order->online_amount,$last_amount,2); + $data['total'] = bcadd($data['online_amount'],$last_amount,2); $data['real_amount'] = $data['total']; $data['performance'] = bcsub($data['real_amount'],$cost,2); $order->allowField(true)->save($data); diff --git a/application/admin/view/orders/dispatch2/edit.html b/application/admin/view/orders/dispatch2/edit.html index 83ce45f..a0032b8 100644 --- a/application/admin/view/orders/dispatch2/edit.html +++ b/application/admin/view/orders/dispatch2/edit.html @@ -89,7 +89,7 @@
- +
@@ -107,7 +107,7 @@
- +
@@ -153,28 +153,31 @@ {/if} -
+ + + -
- -
-
- -
- - + +
From 7a495ed5dca3079887a7baad31e914050cae688c Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 14:02:31 +0800 Subject: [PATCH 78/92] tts --- application/admin/controller/Order.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 2043a86..51bbdbc 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -129,6 +129,8 @@ class Order extends Backend public function index() { + ini_set('memory_limit', '512M'); + $this->request->filter(['strip_tags', 'trim']); $group = \model('auth_group_access')->where('uid', $this->auth->id)->find()->group_id ?? 0; $user = \model('admin')->find($this->auth->id); From 0b8bb8c526b7a21788356380d62f823059acfcba Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 15:15:40 +0800 Subject: [PATCH 79/92] tts --- application/admin/controller/Order.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 51bbdbc..2043a86 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -129,8 +129,6 @@ class Order extends Backend public function index() { - ini_set('memory_limit', '512M'); - $this->request->filter(['strip_tags', 'trim']); $group = \model('auth_group_access')->where('uid', $this->auth->id)->find()->group_id ?? 0; $user = \model('admin')->find($this->auth->id); From 82d3d57bc6d1de39dae7f800b1cd78425db495f0 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 16:04:09 +0800 Subject: [PATCH 80/92] tts --- application/admin/controller/statistics/Dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/controller/statistics/Dispatcher.php b/application/admin/controller/statistics/Dispatcher.php index 5d53698..55588c5 100644 --- a/application/admin/controller/statistics/Dispatcher.php +++ b/application/admin/controller/statistics/Dispatcher.php @@ -144,7 +144,7 @@ class Dispatcher extends Backend "IFNULL(SUM(CASE WHEN status = 60 THEN (cost + material_cost) END), 0) AS cost_total", //总成本 "IFNULL(SUM(CASE WHEN status = 60 THEN (refund_amount + worker_refund_amount) END), 0) AS refund_total", //退款总数 "IFNULL(COUNT(CASE WHEN refund_amount > 0 OR worker_refund_amount > 0 THEN 1 END), 0) AS refund_count", //退款订单数量 - "IFNULL(AVG(CASE WHEN status > 10 THEN UNIX_TIMESTAMP(dispatch_time) - UNIX_TIMESTAMP(create_time) END), 0) AS avg_time_diff", //派单时效 + "IFNULL(AVG(CASE WHEN status = 60 THEN UNIX_TIMESTAMP(dispatch_time) - UNIX_TIMESTAMP(create_time) END), 0) AS avg_time_diff", //派单时效 // "SUM(CASE WHEN status = 60 THEN (field1 + field2) END) AS performance", ]; From 58160b8f8c3ea50ae6db64bd03ffb27dbe055971 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 16:05:36 +0800 Subject: [PATCH 81/92] tts --- application/admin/controller/statistics/Dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/controller/statistics/Dispatcher.php b/application/admin/controller/statistics/Dispatcher.php index 55588c5..7a09d4f 100644 --- a/application/admin/controller/statistics/Dispatcher.php +++ b/application/admin/controller/statistics/Dispatcher.php @@ -137,7 +137,7 @@ class Dispatcher extends Backend // 使用 IFNULL 确保结果为 null 时返回 0 "IFNULL(COUNT(CASE WHEN status = 60 THEN 1 END), 0) AS finish_num", //完成数 "IFNULL(COUNT(CASE WHEN status IN (".$orderValid.") THEN 1 END), 0) AS count_num", //总订单数 (排除取消 和草稿) - "IFNULL(COUNT(CASE WHEN is_overtime = 1 THEN 1 END), 0) AS overtime_num", //超时数 + "IFNULL(COUNT(CASE WHEN status = 60 AND is_overtime = 1 THEN 1 END), 0) AS overtime_num", //超时数 "IFNULL(SUM(CASE WHEN status = 60 THEN total END), 0) AS total", //成效额 "IFNULL(SUM(CASE WHEN status = 60 THEN performance END), 0) AS performance", //业绩 From 5d8d61530286e814e6b60353aa8e8128cadee54a Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 16:07:46 +0800 Subject: [PATCH 82/92] tts --- application/admin/controller/statistics/Dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/controller/statistics/Dispatcher.php b/application/admin/controller/statistics/Dispatcher.php index 7a09d4f..e777044 100644 --- a/application/admin/controller/statistics/Dispatcher.php +++ b/application/admin/controller/statistics/Dispatcher.php @@ -143,7 +143,7 @@ class Dispatcher extends Backend "IFNULL(SUM(CASE WHEN status = 60 THEN performance END), 0) AS performance", //业绩 "IFNULL(SUM(CASE WHEN status = 60 THEN (cost + material_cost) END), 0) AS cost_total", //总成本 "IFNULL(SUM(CASE WHEN status = 60 THEN (refund_amount + worker_refund_amount) END), 0) AS refund_total", //退款总数 - "IFNULL(COUNT(CASE WHEN refund_amount > 0 OR worker_refund_amount > 0 THEN 1 END), 0) AS refund_count", //退款订单数量 + "IFNULL(COUNT(CASE WHEN status = 60 AND (refund_amount > 0 OR worker_refund_amount > 0) THEN 1 END), 0) AS refund_count", //退款订单数量 "IFNULL(AVG(CASE WHEN status = 60 THEN UNIX_TIMESTAMP(dispatch_time) - UNIX_TIMESTAMP(create_time) END), 0) AS avg_time_diff", //派单时效 // "SUM(CASE WHEN status = 60 THEN (field1 + field2) END) AS performance", ]; From f90e1ed9b4ef8af4ec75a1bac1dad448d10038d4 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 16:10:50 +0800 Subject: [PATCH 83/92] tts --- application/admin/controller/statistics/Dispatcher.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/admin/controller/statistics/Dispatcher.php b/application/admin/controller/statistics/Dispatcher.php index e777044..2f59615 100644 --- a/application/admin/controller/statistics/Dispatcher.php +++ b/application/admin/controller/statistics/Dispatcher.php @@ -142,7 +142,10 @@ class Dispatcher extends Backend "IFNULL(SUM(CASE WHEN status = 60 THEN total END), 0) AS total", //成效额 "IFNULL(SUM(CASE WHEN status = 60 THEN performance END), 0) AS performance", //业绩 "IFNULL(SUM(CASE WHEN status = 60 THEN (cost + material_cost) END), 0) AS cost_total", //总成本 - "IFNULL(SUM(CASE WHEN status = 60 THEN (refund_amount + worker_refund_amount) END), 0) AS refund_total", //退款总数 + //"IFNULL(SUM(CASE WHEN status = 60 THEN (refund_amount + worker_refund_amount) END), 0) AS refund_total", //退款总数 + "SUM( + CASE WHEN status = 60 THEN (refund_amount + worker_refund_amount) ELSE 0 END +) AS refund_total", "IFNULL(COUNT(CASE WHEN status = 60 AND (refund_amount > 0 OR worker_refund_amount > 0) THEN 1 END), 0) AS refund_count", //退款订单数量 "IFNULL(AVG(CASE WHEN status = 60 THEN UNIX_TIMESTAMP(dispatch_time) - UNIX_TIMESTAMP(create_time) END), 0) AS avg_time_diff", //派单时效 // "SUM(CASE WHEN status = 60 THEN (field1 + field2) END) AS performance", From 6d6c11d2ab5413f7c4142c4841d8324a96d189ca Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 16:21:39 +0800 Subject: [PATCH 84/92] tts --- application/admin/view/orders/dispatch2/edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/view/orders/dispatch2/edit.html b/application/admin/view/orders/dispatch2/edit.html index a0032b8..dee9247 100644 --- a/application/admin/view/orders/dispatch2/edit.html +++ b/application/admin/view/orders/dispatch2/edit.html @@ -107,7 +107,7 @@
- +
From 11c9e4c179da374034c6d1c2776886240c8d5e2e Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 16:53:01 +0800 Subject: [PATCH 85/92] tts --- application/admin/controller/Order.php | 9 +++++++++ application/admin/model/Order.php | 3 ++- public/assets/js/backend/order.js | 9 ++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 2043a86..02433ea 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -320,6 +320,7 @@ class Order extends Backend $params['create_time'] = date('Y-m-d H:i:s'); $params['update_time'] = date('Y-m-d H:i:s'); $params['receive_type'] = $params['receive_type']?: 1; + $params['audit_time'] = date('Y-m-d H:i:s'); $result = $this->model->allowField(true)->save($params); $auth = clone $this->auth; @@ -877,6 +878,9 @@ class Order extends Backend unset($filter['area_id']); + if(isset($filter['audit_time'])){ + $filter['status'] = \app\admin\model\Order::STATUS_FINISHED; + } $filter = $filter ? $filter : []; $where = []; @@ -909,6 +913,11 @@ class Order extends Backend } $index = 0; $op = (array)json_decode($op, true); + + if(isset($filter['audit_time'])){ + $op['status'] = '='; + } + foreach ($filter as $k => $v) { if ($k == 'user.nickname' || $k == 'is_timeout') continue; if (!preg_match('/^[a-zA-Z0-9_\-\.]+$/', $k)) { diff --git a/application/admin/model/Order.php b/application/admin/model/Order.php index 1036f48..136fcef 100644 --- a/application/admin/model/Order.php +++ b/application/admin/model/Order.php @@ -167,7 +167,8 @@ class Order extends Model self::STATUS_CHECKING, self::STATUS_CHECKONCE, self::STATUS_AUDITING, - self::STATUS_FINISHED + self::STATUS_FINISHED, + self::STATUS_AFTERSALE ], ]; return $tabStatus[$tab] ?? []; diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js index 93a3e62..476c045 100644 --- a/public/assets/js/backend/order.js +++ b/public/assets/js/backend/order.js @@ -229,7 +229,14 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'} title: '完成时间', operate: 'RANGE', addclass: 'datetimerange', - autocomplete: false + autocomplete: false, + formatter: function (value, row, index) { + if (row.status === 60){ + return value; + }else{ + return ''; + } + } }, { From 8a9499733df6a36ec454ce8d9428d82ceeed153f Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 16:55:22 +0800 Subject: [PATCH 86/92] tts --- application/admin/controller/Order.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 02433ea..830a891 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -176,6 +176,11 @@ class Order extends Backend ]) ->where($where); $filter = (array)json_decode(input()['filter'] ?? '', true); + + if(isset($filter['audit_time'])){ + $build->where('status',\app\admin\model\Order::STATUS_FINISHED); + } + $admin_filter = $filter['user.nickname'] ?? false; $area_id = $filter['area_id'] ?? false; $item_id = $filter['item_id'] ?? false; @@ -878,9 +883,6 @@ class Order extends Backend unset($filter['area_id']); - if(isset($filter['audit_time'])){ - $filter['status'] = \app\admin\model\Order::STATUS_FINISHED; - } $filter = $filter ? $filter : []; $where = []; @@ -913,11 +915,6 @@ class Order extends Backend } $index = 0; $op = (array)json_decode($op, true); - - if(isset($filter['audit_time'])){ - $op['status'] = '='; - } - foreach ($filter as $k => $v) { if ($k == 'user.nickname' || $k == 'is_timeout') continue; if (!preg_match('/^[a-zA-Z0-9_\-\.]+$/', $k)) { From afad29d9f2c088ec1bc6a75b995a19184effc14b Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 17:05:09 +0800 Subject: [PATCH 87/92] tts --- public/assets/js/backend/order.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js index 476c045..c00b0db 100644 --- a/public/assets/js/backend/order.js +++ b/public/assets/js/backend/order.js @@ -231,10 +231,10 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'} addclass: 'datetimerange', autocomplete: false, formatter: function (value, row, index) { - if (row.status === 60){ + if (row.status >= 60){ return value; }else{ - return ''; + return '-'; } } }, From a08d4aaf20c354ec29cdbec295ca56398265e25e Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 17:09:25 +0800 Subject: [PATCH 88/92] tts --- application/admin/controller/Order.php | 4 ++++ public/assets/js/backend/order.js | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 830a891..4c7e786 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -249,6 +249,10 @@ class Order extends Backend }else{ $item->source_total_name = ($item->getRelation('source')->title??''); } + + if($item->stattus <60){ + $item->audit_time = null; + } unset($item->source); } diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js index c00b0db..93a3e62 100644 --- a/public/assets/js/backend/order.js +++ b/public/assets/js/backend/order.js @@ -229,14 +229,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'} title: '完成时间', operate: 'RANGE', addclass: 'datetimerange', - autocomplete: false, - formatter: function (value, row, index) { - if (row.status >= 60){ - return value; - }else{ - return '-'; - } - } + autocomplete: false }, { From fddd4344c8cd1800c50d6dc820033eb68cfe24be Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 17:10:47 +0800 Subject: [PATCH 89/92] tts --- application/admin/controller/Order.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index 4c7e786..70f3205 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -250,7 +250,7 @@ class Order extends Backend $item->source_total_name = ($item->getRelation('source')->title??''); } - if($item->stattus <60){ + if($item->status <60){ $item->audit_time = null; } unset($item->source); From 1831da9d83e3ab3095fc6a97c9fddc98d183e253 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 9 Jul 2025 17:17:56 +0800 Subject: [PATCH 90/92] tts --- application/admin/controller/aftersales/Aftersale.php | 1 + application/admin/controller/aftersales/Aftersale2.php | 1 + 2 files changed, 2 insertions(+) diff --git a/application/admin/controller/aftersales/Aftersale.php b/application/admin/controller/aftersales/Aftersale.php index 5a9cf39..3ec0905 100644 --- a/application/admin/controller/aftersales/Aftersale.php +++ b/application/admin/controller/aftersales/Aftersale.php @@ -264,6 +264,7 @@ class Aftersale extends Backend $this->error('订单不存在'); } $order->status = Order::STATUS_FINISHED; + $order->audit_time = date('Y-m-d H:i:s'); $order->save(); } diff --git a/application/admin/controller/aftersales/Aftersale2.php b/application/admin/controller/aftersales/Aftersale2.php index 341e8cb..a34707a 100644 --- a/application/admin/controller/aftersales/Aftersale2.php +++ b/application/admin/controller/aftersales/Aftersale2.php @@ -478,6 +478,7 @@ class Aftersale2 extends Backend $order = Order::get($row->order_id); //重新计算订单利润 $order->status = Order::STATUS_FINISHED; + $order->audit_time = date('Y-m-d H:i:s'); $order->save(); $orderLogic = new OrderLogic(); $orderLogic->recacle($order,$row); From cb1908faf4477eb0e8a6977aa01981202520bf7c Mon Sep 17 00:00:00 2001 From: zhuyu Date: Thu, 10 Jul 2025 15:04:45 +0800 Subject: [PATCH 91/92] =?UTF-8?q?feature:=20=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=9A=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/dashboard/kpi_presale.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/admin/view/dashboard/kpi_presale.html b/application/admin/view/dashboard/kpi_presale.html index f159350..be42f86 100644 --- a/application/admin/view/dashboard/kpi_presale.html +++ b/application/admin/view/dashboard/kpi_presale.html @@ -11,14 +11,12 @@
- -
姓名 录单数录单业绩
{$adminname|htmlentities} {$data['total']|htmlentities}{$data['money']|htmlentities}
From c2c8593a162f5967362b908847edc1a14dee3dd4 Mon Sep 17 00:00:00 2001 From: todaywindy Date: Thu, 10 Jul 2025 18:12:24 +0800 Subject: [PATCH 92/92] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/statistics/Item.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/statistics/Item.php b/application/admin/controller/statistics/Item.php index b5c9277..7396079 100644 --- a/application/admin/controller/statistics/Item.php +++ b/application/admin/controller/statistics/Item.php @@ -86,6 +86,8 @@ class Item extends Backend public function list() { $build = new Order(); + [$where, $sort, $order, $offset, $limit] = $this->buildparams(); + $start = now()->modify('-7 days')->format('Y-m-d'); $end_at = now()->format('Y-m-d 23:29:59'); @@ -139,7 +141,7 @@ class Item extends Backend ])->group('item_title') ->order('count_num', 'desc'); // dd($total); - $res = $build->paginate(); + $res = $build->paginate($limit); $total = $res->total(); $ress = $res->items(); $data = []; @@ -156,7 +158,7 @@ class Item extends Backend $re['total_avg'] = $this->mydiv($re['total'],$re['count_num'],2,false); $re['performance_avg'] = $this->mydiv($re['performance'],$re['finish_num'],2,false); $re['avg_time_diff'] = $this->mydiv($re['avg_time_diff'],3600,2,false); - $re['cost_total'] = $cost_total; + $re['cost_total'] = number_format($cost_total,2,'.',''); // $re['id'] = $re['item_id']; $data [] = $re; }