|
@@ -15,7 +15,7 @@ class CarIllegalDownSpeedController extends BaseController
|
|
|
|
|
|
|
|
|
|
$mineCode = isset($request->mine_code) ? $request->mine_code : null; // 矿分类
|
|
$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"); // 开始时间
|
|
$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"); // 结束时间
|
|
$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++) {
|
|
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['data'][] = $res[0]->con ?? 0;
|
|
}
|
|
}
|
|
$data3['name']="数量";
|
|
$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 = [
|
|
$data = [
|
|
"total"=>reset($dataTotal[0]),
|
|
"total"=>reset($dataTotal[0]),
|
|
"speeding_con"=>$res1,
|
|
"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);
|
|
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 = '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 .= 'FROM down_car_speed_warn a ';
|
|
$sqlStr .= 'join down_car_base_info b on a.car_num = b.car_num ';
|
|
$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 ";
|
|
$sqlStr .= "order by a.warn_start_time desc ";
|
|
|
|
|
|
$conn = 'etl_'.$mineCode;
|
|
$conn = 'etl_'.$mineCode;
|