|
@@ -2026,13 +2026,17 @@ class Lampcontrol extends Base_Controller {
|
|
|
exit(json_result('0418',$this->response['0418']));
|
|
|
}
|
|
|
$beginDate = $res[0];
|
|
|
- $endDate = $res[1];
|
|
|
+ $endDate = date('Y-m-d 23:59:59',strtotime($res[1]));
|
|
|
+ // var_dump($endDate);die;
|
|
|
}
|
|
|
$sql = "SELECT P.id,P.patrolinterval FROM lampinfo AS L LEFT JOIN project as P on P.id = L.projectid WHERE L.id = {$lampId} limit 1";
|
|
|
$lampData = $this->db->query($sql)->row_array();
|
|
|
$timezoneData = $this->Project_model->get_timezone_by_projectid($lampData['id']);
|
|
|
$timezone = $timezoneData['value'];
|
|
|
|
|
|
+ $beginDate = date('Y-m-d H:i:s',strtotime($beginDate) - $timezone * 3600);
|
|
|
+ $endDate = date('Y-m-d H:i:s',strtotime($endDate) - $timezone * 3600);
|
|
|
+
|
|
|
$data = ['patrolinterval'=>$lampData['patrolinterval']];
|
|
|
if ($type == 0) { // 路灯
|
|
|
$sql = 'select LI.loadvoltage as lampvoltage,LI.loadcurrent as lampcurrent,LI.lighteness,LI.loadpower as lamppower,LI.updatetime from realtime_info_log as LI where LI.lampid = '.$lampId.' and LI.updatetime >= "'.$beginDate.'" and LI.updatetime <= "'.$endDate.'"';
|
|
@@ -2044,7 +2048,7 @@ class Lampcontrol extends Base_Controller {
|
|
|
$temp['lampcurrent'][] = $value['lampcurrent'];
|
|
|
$temp['lamppower'][] = $value['lamppower'];
|
|
|
$temp['lighteness'][] = $value['lighteness'];
|
|
|
- $temp['updatetime'][] = date_change($value['updatetime'],8,$timezone);
|
|
|
+ $temp['updatetime'][] = date_change($value['updatetime'],0,$timezone);
|
|
|
if (!isset($data['maxcurrent'])) {
|
|
|
$data['maxcurrent'] = $value['lampcurrent'];
|
|
|
}else{
|