|
@@ -83,9 +83,9 @@ class Lampcontrol extends Base_Controller {
|
|
|
$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.logtime as updatetime, L.updatetime as modifytime,L.overtimes,L.boardpower,L.lighteness as light,L.projectid,L.devstatus as online,N.networkname as network_name,N.type as net_type,P.projectname as project_name,L.section,L.protocoltype as lampProtocoltype,L.loadtype,P.timezone as timezoneid,M.iccid';
|
|
|
+ $fields = 'L.id, L.number, IFNULL(L.status,0) as status, L.isfaulted, L.address, L.lamppower, L.electricSOC, L.battvoltage, L.chargestage, L.logtime as updatetime, L.updatetime as modifytime,L.overtimes,L.boardpower,L.lighteness as light,L.projectid,L.devstatus as online,N.networkname as network_name,N.type as net_type,P.projectname as project_name,L.section,L.loadtype,P.timezone as timezoneid,M.iccid';
|
|
|
}else{
|
|
|
- $fields .= ",L.id,L.projectid,L.section,L.protocoltype as lampProtocoltype,N.devstatus as net_devstatus,L.loadtype,P.timezone as timezoneid,M.iccid";
|
|
|
+ $fields .= ",L.id,L.projectid,L.section,N.devstatus as net_devstatus,L.loadtype,P.timezone as timezoneid,M.iccid";
|
|
|
}
|
|
|
|
|
|
$download = intval($this->input->post('download',true));
|
|
@@ -162,11 +162,7 @@ class Lampcontrol extends Base_Controller {
|
|
|
if ($a == '电池故障') {
|
|
|
$a = '电池电压异常';
|
|
|
}
|
|
|
- if ($value['lampProtocoltype'] == 1) {
|
|
|
- $temp[] = modbus_alarm_translate($a);
|
|
|
- }else{
|
|
|
- $temp[] = alarm_translate($a);
|
|
|
- }
|
|
|
+ $temp[] = alarm_translate($a);
|
|
|
}
|
|
|
$value['isfaulted'] = implode(',', $temp2);
|
|
|
}else{
|
|
@@ -186,9 +182,6 @@ class Lampcontrol extends Base_Controller {
|
|
|
$value['battvoltage'] = !empty($value['battvoltage']) ? $value['battvoltage'] : "0";
|
|
|
}
|
|
|
if (array_key_exists('chargestage',$value)) {
|
|
|
- if ($value['lampProtocoltype'] == 1) {
|
|
|
- $value['chargestage'] = isset($indexArr[intval($value['chargestage'])]) ? $indexArr[intval($value['chargestage'])] : $value['chargestage'];
|
|
|
- }
|
|
|
$value['chargestage'] = isset($value['chargestage']) ? $chargeStageMap[$value['chargestage']] : $unknown;
|
|
|
}
|
|
|
if (array_key_exists('battstatus',$value)) {
|
|
@@ -317,12 +310,7 @@ class Lampcontrol extends Base_Controller {
|
|
|
if ($a == '电池故障') {
|
|
|
$a = '电池电压异常';
|
|
|
}
|
|
|
- if ($value['lampProtocoltype'] == 1) {
|
|
|
- $temp[] = modbus_alarm_translate($a);
|
|
|
- }else{
|
|
|
- $temp[] = alarm_translate($a);
|
|
|
- }
|
|
|
-
|
|
|
+ $temp[] = alarm_translate($a);
|
|
|
}
|
|
|
$value['isfaulted'] = implode(',', $temp);
|
|
|
}else{
|
|
@@ -343,9 +331,6 @@ class Lampcontrol extends Base_Controller {
|
|
|
$value['battvoltage'] = !empty($value['battvoltage']) ? $value['battvoltage'] : "0";
|
|
|
}
|
|
|
if (array_key_exists('chargestage',$value)) {
|
|
|
- if ($value['lampProtocoltype'] == 1) {
|
|
|
- $value['chargestage'] = isset($indexArr[intval($value['chargestage'])]) ? $indexArr[intval($value['chargestage'])] : $value['chargestage'];
|
|
|
- }
|
|
|
$value['chargestage'] = isset($value['chargestage']) && isset($chargeStageMap[$value['chargestage']]) ? $chargeStageMap[$value['chargestage']] : $unknown;
|
|
|
}
|
|
|
if (array_key_exists('battstatus',$value)) {
|