|
@@ -157,15 +157,14 @@ class ApiService{
|
|
|
$date = date('Y-m-d', time());
|
|
|
}
|
|
|
|
|
|
- // $depart = DB::connection('mysql_fwe10_eteams')->table('department')
|
|
|
- // ->where('parent', '100001980000000049')
|
|
|
- // ->where('name', 'like', '%' . '洗煤厂')
|
|
|
- // ->where('id','!=','100001590000001602')
|
|
|
- // ->get();
|
|
|
-
|
|
|
- $depart = DB::connection('mysql_fwe10')->table('uf_zhxx_qlcqyzd')->pluck('szxmc')->toArray();
|
|
|
- $depart = array_unique($depart);
|
|
|
- $depart = array_values($depart);
|
|
|
+// $depart = DB::connection('mysql_fwe10')->table('uf_zhxx_qlcqyzd')->pluck('szxmc')->toArray();
|
|
|
+// $depart = array_unique($depart);
|
|
|
+// $depart = array_values($depart);
|
|
|
+
|
|
|
+ $data = DB::connection('mysql_fwe10')->table('uf_zhxx_qlcxjjl')->where(DB::raw('QUARTER(lrsj)'), DB::raw('QUARTER(CURDATE())'))->pluck('xjdw')->toArray();
|
|
|
+ $counts = array_count_values($data);// 1. 统计每个值的出现次数
|
|
|
+ arsort($counts);// 2. 按出现次数降序排序
|
|
|
+ $depart = array_keys($counts);// 3. 只保留键(去重),并按频率排序
|
|
|
|
|
|
$depart_arr = [];
|
|
|
foreach ($depart as $key => $val) {
|