|
@@ -92,13 +92,13 @@ class Lampcontrol extends Base_Controller {
|
|
|
if(empty($fields)){
|
|
|
$fields = 'L.id, L.number';
|
|
|
}else{
|
|
|
- $fields .= ",L.updatetime";
|
|
|
+ $fields .= ",RI.updatetime";
|
|
|
}
|
|
|
$join = array();
|
|
|
$data['lamps'] = $this->Lamp_model->get_list_by_join($filter, $fields,$limit, $offset, $join, "L.number ASC", NUll, 'L');
|
|
|
} else {
|
|
|
if(empty($fields) || empty($field1)){
|
|
|
- $fields = 'L.id, L.number, IFNULL(L.status,0) as status, L.isfaulted, L.address, L.lamppower, L.electricSOC, L.battvoltage, L.chargestage, L.updatetime, L.updatetime as modifytime,L.overtimes,L.boardpower,L.lighteness as light,L.projectid,L.devstatus as online,P.projectname as project_name,L.section,L.loadtype,P.timezone as timezoneid';
|
|
|
+ $fields = 'L.id, L.number, IFNULL(L.status,0) as status, L.isfaulted, L.address, L.lamppower, L.electricSOC, L.battvoltage, L.chargestage, RI.updatetime, RI.updatetime as modifytime,L.overtimes,L.boardpower,L.lighteness as light,L.projectid,L.devstatus as online,P.projectname as project_name,L.section,L.loadtype,P.timezone as timezoneid';
|
|
|
}else{
|
|
|
$fields .= ",L.id,L.projectid,L.section,L.loadtype,P.timezone as timezoneid";
|
|
|
}
|
|
@@ -379,7 +379,7 @@ class Lampcontrol extends Base_Controller {
|
|
|
// $value['timezoneid'];
|
|
|
if($timezone === null) $timezone = $this->db->query('select value from timezone where id = '.$value['timezoneid'])->row_array();
|
|
|
if ($timezone['value'] != 8) {
|
|
|
- $value['updatetime'] = date_change($value['updatetime'],8,$timezone['value']);
|
|
|
+ $value['updatetime'] = date_change($value['updatetime'],0,$timezone['value']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3502,13 +3502,13 @@ class Lampcontrol extends Base_Controller {
|
|
|
$res = $this->Lamp_model->getListForInfoLog($lamp_id, $table, ($page-1)*$count, $count,$beginDate,$endDate);
|
|
|
}elseif ($table == 'battery_info_log') {
|
|
|
$join = [
|
|
|
- ['table'=>'history_info_log as HI','cond'=>'HI.lampid = RI.lampid and HI.updatetime = RI.updatetime','type'=>'inner'],
|
|
|
+ // ['table'=>'history_info_log as HI','cond'=>'HI.lampid = RI.lampid and HI.updatetime = RI.updatetime','type'=>'inner'],
|
|
|
];
|
|
|
$where = ['HI.lampid'=>$lamp_id,'HI.updatetime >='=>$beginDate,'HI.updatetime <='=>$endDate];
|
|
|
$total = $this->RealtimeInfoLog_model->get_list_by_multi_join($where,'count(*) as total',NULL, NULL, $join, NULL, NUll, 'RI', true);
|
|
|
$total = $total['total'];
|
|
|
|
|
|
- $fields = 'RI.batvoltage as battvoltage,RI.updatetime,HI.overtimes';
|
|
|
+ $fields = 'RI.batvoltage as battvoltage,RI.updatetime,RI.DayOverDisChgTimes as overtimes';
|
|
|
$res = $this->RealtimeInfoLog_model->get_list_by_join($where, $fields,$count, ($page-1)*$count, $join, 'RI.updatetime desc,RI.id desc', NUll, 'RI');
|
|
|
}else{
|
|
|
$total = $this->Lamp_model->getCountForInfoLog($lamp_id, $table,$beginDate,$endDate);
|