From 8ad461ca85e34d038b07f86e68a269733b2584ab Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Thu, 3 Jul 2025 12:27:12 +0800 Subject: [PATCH] sth --- application/admin/controller/Orderplan.php | 2 +- .../admin/controller/orders/Dispatchrecord.php | 11 +++++++---- .../admin/controller/statistics/Dispatcher.php | 6 ++++-- application/admin/controller/statistics/Worker.php | 4 ++-- .../admin/view/statistics/dispatcher/index.html | 4 ++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/application/admin/controller/Orderplan.php b/application/admin/controller/Orderplan.php index 7e1d3fe..97444e1 100644 --- a/application/admin/controller/Orderplan.php +++ b/application/admin/controller/Orderplan.php @@ -221,7 +221,7 @@ class Orderplan extends Backend } - private function buildDate($build, $table_name = null,$name = 'create_time') + private function buildDate($build, $table_name = null,$name = 'audit_time') { $start = now()->modify('-14 days')->format('Y-m-d'); $end_at = now()->format('Y-m-d 23:29:59'); diff --git a/application/admin/controller/orders/Dispatchrecord.php b/application/admin/controller/orders/Dispatchrecord.php index 268c6b2..ffbca36 100644 --- a/application/admin/controller/orders/Dispatchrecord.php +++ b/application/admin/controller/orders/Dispatchrecord.php @@ -121,11 +121,14 @@ class Dispatchrecord extends Backend } if($dispatch->type == 1){ - $timestamp = strtotime('+'.$params['notice_time'].' day'); // 获取明天同一时间的时间戳 - $params['notice_time'] = date('Y-m-d', $timestamp) . ' 09:00:00'; // 拼接为明天的 9 点 - //$dispatch->work_progress = $params['rate']; + $params['need_notice'] = 0; + if(!empty($params['notice_time'])){ + $timestamp = strtotime('+'.$params['notice_time'].' day'); // 获取明天同一时间的时间戳 + $params['notice_time'] = date('Y-m-d', $timestamp) . ' 09:00:00'; // 拼接为明天的 9 点 + //$dispatch->work_progress = $params['rate']; + $params['need_notice'] = 1; + } - $params['need_notice'] = 1; //$params['status'] = 1; /* if(!empty($params['rate'])){ //修改任务的状态 if($dispatch->status != $params['rate']){ diff --git a/application/admin/controller/statistics/Dispatcher.php b/application/admin/controller/statistics/Dispatcher.php index 6f6630c..5d53698 100644 --- a/application/admin/controller/statistics/Dispatcher.php +++ b/application/admin/controller/statistics/Dispatcher.php @@ -161,12 +161,14 @@ class Dispatcher extends Backend } if(!empty($filter['start_time']) && !empty($filter['end_time'])){ - $time_by = $filter['time_by'] ??1; + /*$time_by = $filter['time_by'] ??1; if($time_by == 1){ //按派单时间 $time_field = 'dispatch_time'; }else{ //按录单时间 $time_field = 'create_time'; - } + }*/ + + $time_field = 'audit_time'; $builder->whereBetween($time_field,[$filter['start_time'],$filter['end_time']]); } //城市 diff --git a/application/admin/controller/statistics/Worker.php b/application/admin/controller/statistics/Worker.php index 865e8d0..114c419 100644 --- a/application/admin/controller/statistics/Worker.php +++ b/application/admin/controller/statistics/Worker.php @@ -317,10 +317,10 @@ class Worker extends Backend $builder = (new Order())->field($fields); if(!empty($filter['start_time'])){ - $builder->where('create_time','>=',$filter['start_time']); + $builder->where('audit_time','>=',$filter['start_time']); } if(!empty($filter['end_time'])){ - $builder->where('create_time','<=',$filter['end_time']); + $builder->where('audit_time','<=',$filter['end_time']); } if(!empty($filter['worker_ids'])){ $builder->where('worker_id','in',$filter['worker_ids']); diff --git a/application/admin/view/statistics/dispatcher/index.html b/application/admin/view/statistics/dispatcher/index.html index f973066..d9e0be7 100644 --- a/application/admin/view/statistics/dispatcher/index.html +++ b/application/admin/view/statistics/dispatcher/index.html @@ -26,14 +26,14 @@