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] 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: [