|
@@ -702,14 +702,16 @@ class Map extends Base_Controller{
|
|
|
$arr = $this->Lamp_model->getTotalLampInfo($role, 0, $project_id, $userid,1);
|
|
|
if (!empty($arr['num'])) {
|
|
|
$online_arr = $this->Lamp_model->get_count(['projectid'=>$project_id,'netStatus'=>1]);
|
|
|
- $lighting_arr = $this->Lamp_model->getCountByFilter($role, 0, $project_id, $userid, array('L.status'=>1));
|
|
|
+ $failure = $this->Lamp_model->get_count(['projectid'=>$project_id,'controllerstatus'=>5]);
|
|
|
+ $lighting_arr = $this->Lamp_model->get_count(['projectid'=>$project_id,'lighteness >'=>0]);
|
|
|
+ // $lighting_arr = $this->Lamp_model->getCountByFilter($role, 0, $project_id, $userid, array('L.status'=>1));
|
|
|
// $failure = $this->Lamp_model->get_fault_count(array('L.projectid'=>$project_id,'L.isfaulted'=>1), $role, 0, $userid);
|
|
|
- $failure = 0;
|
|
|
+ // $failure = 0;
|
|
|
|
|
|
$data['online_rate'] = round($online_arr/$arr['num']*100, 2);
|
|
|
- $data['lighting_rate'] = round($lighting_arr['num']/$arr['num']*100, 2);
|
|
|
+ $data['lighting_rate'] = round($lighting_arr/$arr['num']*100, 2);
|
|
|
$data['online_count'] = intval($online_arr);
|
|
|
- $data['lighting_count'] = intval($lighting_arr['num']);
|
|
|
+ $data['lighting_count'] = intval($lighting_arr);
|
|
|
$data['failure_rate'] = round($failure/$arr['num']*100, 2);
|
|
|
$data['failure_count'] = intval($failure);
|
|
|
$data['totalgeneration'] = round($arr['power']/1000, 2);
|