q 1 år sedan
förälder
incheckning
eb11df93f6

+ 6 - 6
Modules/OpcData/Http/Controllers/Api/CarIllageDownLightController.php

@@ -63,10 +63,10 @@ class CarIllageDownLightController extends BaseController
         // 一周内超速趋势
         for($i = 1; $i <= 7; $i++) {
 
-            $statisDate = date("Y-m-d", strtotime("-".(7-$i)." day"));
+            $date = date("Y-m-d", strtotime("-".(7-$i)." day"));
 
-            $res = $this->getCarIllegalCount($statisDate, $mineCode);
-            $categories3[]= substr($statisDate, -5);
+            $res = $this->getCarIllegalCount($date, $mineCode);
+            $categories3[]= substr($date, -5);
             $data3['data'][] = $res[0]->con ?? 0;
         }
         $data3['name']="数量";
@@ -97,9 +97,9 @@ class CarIllageDownLightController extends BaseController
     }
 
     // 超速详细列表
-    public function getCarIllegalList($startTime, $mineCode='zaoquan', $page=0, $perPage = 15) {
+    public function getCarIllegalList($statisDate, $mineCode='zaoquan', $page=0, $perPage = 15) {
 
-        if ($startTime == null) return null;
+        if ($statisDate == null) return null;
         $sqlStr =  /** @lang text */
                     'select b.numberplate,
                             a.warn_start_time,
@@ -108,7 +108,7 @@ class CarIllageDownLightController extends BaseController
                        from down_car_run_red_light_warn a
                        join down_car_base_info b on a.car_num = b.car_num
                        join down_light_info c on a.light_num = c.light_num
-                      where statis_date = "'.$startTime.'" order by a.warn_start_time desc ';
+                      where statis_date = "'.$statisDate.'" order by a.warn_start_time desc ';
 
         $dbResult = $this->executeSql($sqlStr, 4, $mineCode);
 

+ 7 - 7
Modules/OpcData/Http/Controllers/Api/CarIllegalDownController.php

@@ -63,10 +63,10 @@ class CarIllegalDownController extends BaseController
         // 一周内超速趋势
         for($i = 1; $i <= 7; $i++) {
 
-            $statisDate = date("Y-m-d", strtotime("-".(7-$i)." day"));
+            $date = date("Y-m-d", strtotime("-".(7-$i)." day"));
 
-            $res = $this->getCarIllegalCount($statisDate, $mineCode);
-            $categories3[]= substr($statisDate, -5);
+            $res = $this->getCarIllegalCount($date, $mineCode);
+            $categories3[]= substr($date, -5);
             $data3['data'][] = $res[0]->con ?? 0;
         }
         $data3['name']="数量";
@@ -102,9 +102,9 @@ class CarIllegalDownController extends BaseController
     }
 
     // 详细列表
-    public function getCarIllegalList($startTime, $mineCode='zaoquan', $page=0, $perPage = 15) {
+    public function getCarIllegalList($statisDate, $mineCode='zaoquan', $page=0, $perPage = 15) {
 
-        if ($startTime == null) return null;
+        if ($statisDate == null) return null;
         $sqlStr =  /** @lang text */
 
             "select * from (
@@ -116,7 +116,7 @@ class CarIllegalDownController extends BaseController
                       from down_car_run_red_light_warn a
                         join down_car_base_info b on a.car_num = b.car_num
                         join down_light_info c on a.light_num = c.light_num
-                     where statis_date = '".date("Y-m-d", strtotime($startTime))."'
+                     where statis_date = '".date("Y-m-d", strtotime($statisDate))."'
                      union all
                      select '超速' illegal_type,
                             b.numberplate,
@@ -125,7 +125,7 @@ class CarIllegalDownController extends BaseController
                             concat(a.act_val, ' km/h')
                      from down_car_speed_warn a
                      join down_car_base_info b on a.car_num = b.car_num
-                    where statis_date = '".date("Y-m-d", strtotime($startTime))."'
+                    where statis_date = '".date("Y-m-d", strtotime($statisDate))."'
                 ) t order by warn_start_time desc";
 
         $dbResult = $this->executeSql($sqlStr, 4, $mineCode);

+ 11 - 11
Modules/OpcData/Http/Controllers/Api/CarIllegalDownSpeedController.php

@@ -15,7 +15,7 @@ class CarIllegalDownSpeedController extends BaseController
 
 
         $mineCode = isset($request->mine_code) ? $request->mine_code : null;     // 矿分类
-        $stateDate = isset($request->date) ? $request->date : date("Y-m-d"); // 统计日期
+        $statisDate = isset($request->date) ? $request->date : date("Y-m-d"); // 统计日期
 
         $listStartTime = isset($request->date) ? $request->date.' 00:00:00' : date("Y-m-d 00:00:00");   // 开始时间
         $listEndTime = isset($request->date) ? $request->date.' 23:59:59' : date("Y-m-d 23:59:59");     // 结束时间
@@ -65,10 +65,10 @@ class CarIllegalDownSpeedController extends BaseController
         // 一周内超速趋势
         for($i = 1; $i <= 7; $i++) {
 
-            $stateDate = date("Y-m-d", strtotime("-".(7-$i)." day"));
+            $date = date("Y-m-d", strtotime("-".(7-$i)." day"));
 
-            $res = $this->getCarIllegalCount($stateDate, $mineCode);
-            $categories3[]= substr($stateDate, -5);
+            $res = $this->getCarIllegalCount($date, $mineCode);
+            $categories3[]= substr($date, -5);
             $data3['data'][] = $res[0]->con ?? 0;
         }
         $data3['name']="数量";
@@ -78,8 +78,8 @@ class CarIllegalDownSpeedController extends BaseController
         ];
 
         // 违章数据列表
-        $dataList = $this->getCarIllegalList($stateDate, $mineCode, $page, $perPage);
-        $dataTotal = $this->getCarIllegalCount($stateDate, $mineCode);
+        $dataList = $this->getCarIllegalList($statisDate, $mineCode, $page, $perPage);
+        $dataTotal = $this->getCarIllegalCount($statisDate, $mineCode);
         $data = [
             "total"=>reset($dataTotal[0]),
             "speeding_con"=>$res1,
@@ -90,24 +90,24 @@ class CarIllegalDownSpeedController extends BaseController
     }
 
     // 今日超速统计
-    public function getCarIllegalCount($stateDate, $mineCode='zaoquan') {
+    public function getCarIllegalCount($statisDate, $mineCode='zaoquan') {
 
-        $sqlStr = "select count(car_num) con from `down_car_speed_warn` where statis_date = '".date("Y-m-d", strtotime($stateDate))."'";
+        $sqlStr = "select count(car_num) con from `down_car_speed_warn` where statis_date = '".date("Y-m-d", strtotime($statisDate))."'";
 
         return $this->executeSql($sqlStr, 2, $mineCode);
 
     }
 
     // 超速详细列表
-    public function getCarIllegalList($startTime, $mineCode='zaoquan', $page=0, $perPage = 15) {
+    public function getCarIllegalList($statisDate, $mineCode='zaoquan', $page=0, $perPage = 15) {
 
 
-        if ($startTime == null) return null;
+        if ($statisDate == null) return null;
 
         $sqlStr = 'SELECT b.numberplate, b.car_type, b.department, a.warn_start_time, a.warn_stop_time, a.act_val, a.warn_val ';
         $sqlStr .= 'FROM down_car_speed_warn a ';
         $sqlStr .= 'join down_car_base_info b on a.car_num = b.car_num ';
-        $sqlStr .= 'where a.statis_date = "'.$startTime.'"';
+        $sqlStr .= 'where a.statis_date = "'.$statisDate.'"';
         $sqlStr .= "order by a.warn_start_time desc ";
 
         $conn   = 'etl_'.$mineCode;