From 3fb6925a8f1d7222c60462e1b99ec876c61a4d4f Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 28 Apr 2025 16:37:32 +0800 Subject: [PATCH] sth --- application/admin/controller/Ajax.php | 8 ++++---- .../admin/controller/statistics/Worker.php | 8 +++----- application/admin/model/Worker.php | 2 +- .../admin/view/statistics/worker/index.html | 15 +++++++++++++++ public/assets/js/backend/statistics/worker.js | 9 +++++++++ 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index 4fd33e1..9b603d6 100755 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -294,17 +294,17 @@ class Ajax extends Backend $province = $this->request->get('province'); $city = $this->request->get('city'); } - $where = ['pid' => 0, 'level' => 1]; + $where = ['level' => 1]; $provincelist = null; if ($province !== null) { - $where['pid'] = $province; + $where['code'] = ['like',$province."%"]; $where['level'] = 2; if ($city !== null) { - $where['pid'] = $city; + $where['code'] = ['like',$city."%"]; $where['level'] = 3; } } - $provincelist = Db::name('area')->where($where)->field('id as value,name')->select(); + $provincelist = Db::name('areas')->where($where)->field('id as value,name')->select(); $this->success('', '', $provincelist); } diff --git a/application/admin/controller/statistics/Worker.php b/application/admin/controller/statistics/Worker.php index 081ba98..039725e 100644 --- a/application/admin/controller/statistics/Worker.php +++ b/application/admin/controller/statistics/Worker.php @@ -37,6 +37,9 @@ class Worker extends Backend */ private OrderDispatch $DispatchModel; + + protected $relationSearch = true; + public function _initialize() { parent::_initialize(); @@ -124,12 +127,7 @@ class Worker extends Backend $filter['end_time'] = trim($arr[1]); } - /*unset($filter['daterange']); // 移除 status - $newFilter = json_encode($filter, JSON_UNESCAPED_UNICODE); - -// 重新赋值到 $_GET,影响 $this->request->get("filter") 后面调用 - $_GET['filter'] = $newFilter;*/ } //派单表 diff --git a/application/admin/model/Worker.php b/application/admin/model/Worker.php index 6f22ed1..5078e8a 100644 --- a/application/admin/model/Worker.php +++ b/application/admin/model/Worker.php @@ -47,7 +47,7 @@ class Worker extends BaseModel public function area() { - return $this->belongsTo('Area', 'area_id', 'area_code'); + return $this->belongsTo('area', 'area_id', 'area_code')->setEagerlyType(0); } public function admin() diff --git a/application/admin/view/statistics/worker/index.html b/application/admin/view/statistics/worker/index.html index 0b8cb66..e048f26 100644 --- a/application/admin/view/statistics/worker/index.html +++ b/application/admin/view/statistics/worker/index.html @@ -344,3 +344,18 @@ + diff --git a/public/assets/js/backend/statistics/worker.js b/public/assets/js/backend/statistics/worker.js index de557ec..dd48a05 100644 --- a/public/assets/js/backend/statistics/worker.js +++ b/public/assets/js/backend/statistics/worker.js @@ -54,6 +54,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t //{field: 'admin_user', title: __('派单员'),operate: "LIKE",visible:false}, //{field: 'city_name', title: __('城市'),operate: "LIKE",visible:false}, //{field: 'city_name', title: __('城市'),operate: "LIKE",visible:false}, + + /*{field: 'area', title: __('城市'), searchList: function (column) { + return Template('sourcetpl', {}); + } + }, +*/ + {field: 'area.merge_name', title: __('地区'),operate: 'LIKE',visible:false}, + {field: 'daterange', title: __('时间筛选'), addclass:'datetimerange', autocomplete:false, operate: "RANGE", @@ -63,6 +71,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t visible:false, defaultValue: Config.default_daterange }, + {field: 'operate', title: __('Operate'), table: table2, events: Table.api.events.operate, formatter: Table.api.formatter.operate, buttons: [ {