|
@@ -275,6 +275,7 @@ class Lampcontrol extends Base_Controller {
|
|
|
$path = push_excel($data,'lampinfoExcel_'.date('Ymd'));
|
|
|
exit(json_result('0000', $this->response['0000'], array('path'=>$path)));
|
|
|
}
|
|
|
+
|
|
|
foreach ($data['lamps'] as $key => &$value) {
|
|
|
$value['section'] = empty($value['section']) ? '' : $value['section'];
|
|
|
if (isset($value['updatetime']) && $value['updatetime'] == '0000-00-00 00:00:00') {
|
|
@@ -366,6 +367,7 @@ class Lampcontrol extends Base_Controller {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// unset($filter['page']);
|
|
|
// unset($filter['count']);
|
|
|
$countWheret1 = implode(' AND ', $countWhere);
|
|
@@ -386,6 +388,7 @@ class Lampcontrol extends Base_Controller {
|
|
|
$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);
|
|
|
+
|
|
|
$data['total_data']['fault_count'] = $res['total'];
|
|
|
$data['total_data']['light_rate'] = empty($data['total_data']['install_num']) ? '0' : round($data['total_data']['light_num']/$data['total_data']['install_num'],4)*100;
|
|
|
$data['total_data']['light_rate'] .= '%';
|
|
@@ -396,7 +399,8 @@ class Lampcontrol extends Base_Controller {
|
|
|
// $data['total_data']['network_num'] = $this->Network_model->get_count(['projectid'=>$project_id,'type'=>1]);
|
|
|
|
|
|
$res = $this->Lamp_model->get_list_by_multi_join($filter, 'count(*) total',$limit, $offset, $join, "L.number ASC", NUll, 'L',true);
|
|
|
- $result = !empty($pid_arr) ? $this->Lamp_model->get_total('L.projectid', $pid_arr, 'L.id') : array();
|
|
|
+ $result = !empty($pid_arr) ? $this->Lamp_model->get_count(['projectid'=>$pid_arr]) : array();
|
|
|
+
|
|
|
$result = $this->Lamp_model->get_count(['projectid'=>$pid_arr]);
|
|
|
$data['total'] = $res['total'];
|
|
|
$data['count'] = $result;
|
|
@@ -612,10 +616,6 @@ class Lampcontrol extends Base_Controller {
|
|
|
$alarmInfo['stralarmtype'] = implode(',', $t);
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($alarmInfo['stralarmtype'])) {
|
|
|
- $this->db->insert('alarm_info_log', $alarmInfo);
|
|
|
- $isfaulted = 1;
|
|
|
- }
|
|
|
$this->Lamp_model->update(array('id'=>$lamp_id),array('status'=>$lampInfo['lampstatus'],'lighteness'=>$lampInfo['lighteness'],'isfaulted'=>$isfaulted));
|
|
|
if ($lampData['status'] == 0) $this->Network_model->update(array('id'=>$lampData['networkid']),array('status'=>1));
|
|
|
}
|