|
@@ -381,7 +381,8 @@ class Lampcontrol extends Base_Controller {
|
|
|
$data['total_data']['online_num'] = $this->Lamp_model->get_count($countWheret1);
|
|
|
|
|
|
$filter2 = $filter.' AND (AI.batstatus != 0 OR AI.panelstatus != 0 OR AI.lampstatus != 0 OR AI.tempstatus != 0)';
|
|
|
- $join = array();
|
|
|
+ $join2 = array();
|
|
|
+ $join2[] = ['table'=>'project as P', 'cond'=>'L.projectid = P.id', 'type'=>'left'];
|
|
|
$join2[] = ['table'=>'(select lampid,max(updatetime) as maxTime from warning_info_log group by lampid) as WI','cond'=>'WI.lampid = L.id','type'=>'inner'];
|
|
|
$join2[] = ['table'=>'warning_info_log as AI','cond'=>'WI.lampid = AI.lampid AND WI.maxTime = AI.updatetime','type'=>'inner'];
|
|
|
$res = $this->Lamp_model->get_list_by_multi_join($filter2, 'count(*) total',null, null, $join2, "L.number ASC", NUll, 'L',true);
|