|
@@ -73,10 +73,12 @@ class Alarm extends Base_Controller {
|
|
|
$t_1 = 'batstatus';
|
|
|
}elseif ($t_ty == 2) {
|
|
|
$t_1 = 'panelstatus';
|
|
|
- }elseif ($t_ty == 2) {
|
|
|
+ }elseif ($t_ty == 3) {
|
|
|
$t_1 = 'lampstatus';
|
|
|
- }else {
|
|
|
+ }elseif ($t_ty == 4) {
|
|
|
$t_1 = 'tempstatus';
|
|
|
+ }else {
|
|
|
+ $t_1 = 'onlinestatus';
|
|
|
}
|
|
|
|
|
|
$where[] = 'AI.'.$t_1.' = '.$t_ty2;
|
|
@@ -98,7 +100,7 @@ class Alarm extends Base_Controller {
|
|
|
$join[] = ['table'=>'global_location as G','cond'=>'G.id = P.cityid','type'=>'inner'];
|
|
|
$where[] = '(AI.batstatus != 0 OR AI.panelstatus != 0 OR AI.lampstatus != 0 OR AI.tempstatus != 0)';
|
|
|
$where = implode(' AND ', $where);
|
|
|
- $alarm = $this->Alarm_model->get_list_by_join($where, 'AI.batstatus,AI.panelstatus,AI.lampstatus,AI.tempstatus,AI.status,AI.updatetime,G.timezone,L.number,P.projectname as project,AI.id',$limit, $offset, $join, 'AI.updatetime DESC,id DESC', NUll, 'AI');
|
|
|
+ $alarm = $this->Alarm_model->get_list_by_join($where, 'AI.batstatus,AI.panelstatus,AI.lampstatus,AI.tempstatus,AI.status,AI.onlinestatus,AI.updatetime,G.timezone,L.number,P.projectname as project,AI.id',$limit, $offset, $join, 'AI.updatetime DESC,id DESC', NUll, 'AI');
|
|
|
$total = $this->Alarm_model->get_list_by_multi_join($where, 'count(*) as total',null, null, $join, null, NUll, 'AI',true);
|
|
|
$total = $total['total'];
|
|
|
// $alarm = $this->Alarm_model->getList($filter, $role, $user_id, $page, $count,1);
|
|
@@ -110,7 +112,7 @@ class Alarm extends Base_Controller {
|
|
|
$join[] = ['table'=>'global_location as G','cond'=>'G.id = P.cityid','type'=>'inner'];
|
|
|
$where[] = '(AI.batstatus != 0 OR AI.panelstatus != 0 OR AI.lampstatus != 0 OR AI.tempstatus != 0)';
|
|
|
$where = implode(' AND ', $where);
|
|
|
- $alarm = $this->Alarm_model->get_list_by_join($where, 'AI.batstatus,AI.panelstatus,AI.lampstatus,AI.tempstatus,AI.status,AI.updatetime,G.timezone,L.number,P.projectname as project,AI.id',$limit, $offset, $join, 'AI.updatetime DESC,id DESC', NUll, 'AI');
|
|
|
+ $alarm = $this->Alarm_model->get_list_by_join($where, 'AI.batstatus,AI.panelstatus,AI.lampstatus,AI.tempstatus,AI.status,AI.onlinestatus,AI.updatetime,G.timezone,L.number,P.projectname as project,AI.id',$limit, $offset, $join, 'AI.updatetime DESC,id DESC', NUll, 'AI');
|
|
|
$total = $this->Alarm_model->get_list_by_multi_join($where, 'count(*) as total',null, null, $join, null, NUll, 'AI',true);
|
|
|
$total = $total['total'];
|
|
|
}
|
|
@@ -130,6 +132,7 @@ class Alarm extends Base_Controller {
|
|
|
if (isset($panelstatus[$value['panelstatus']])) $temp2[] = $panelstatus[$value['panelstatus']];
|
|
|
if (isset($lampstatus[$value['lampstatus']])) $temp2[] = $lampstatus[$value['lampstatus']];
|
|
|
if (isset($tempstatus[$value['tempstatus']])) $temp2[] = $tempstatus[$value['tempstatus']];
|
|
|
+ if (isset($onlinestatus[$value['onlinestatus']])) $temp2[] = $onlinestatus[$value['onlinestatus']];
|
|
|
$value['stralarmtype'] = implode(',', $temp2);
|
|
|
$value['updatetime'] = set_timezone($value['updatetime'],$value['timezone']);
|
|
|
}
|