colly_wyx
2018-06-13 e4d5467f055ece8cc9dfdc02dd836bcc187034a5
Yfs/Api/Data.php
@@ -98,24 +98,25 @@
            $result = $data_daily_service->getUserDataList($this->user_id, $this->start_time, $this->end_time);
            if($result){
                $res_avg = $data_daily_service->getUserDataAvg($this->user_id, $this->start_time, $this->end_time);
                if($res_avg < 0.25){
                    $res_status = '安全';
                if($res_avg < 0.16){
                    $res_status = '绝对安全';
                }
                elseif($res_avg >= 0.25 && $res_avg < 0.8){
                    $res_status = '轻微';
                elseif($res_avg >= 0.16 && $res_avg < 0.8){
                    $res_status = '建议回避';
                }
                elseif($res_avg >= 0.8 && $res_avg < 2){
                    $res_status = '中度';
                    $res_status = '及时闪躲';
                }
                else{
                    $res_status = '严重';
                    $res_status = '紧急撤离';
                }
                $rs['msg'] = '数据获取成功';
                $rs['info'] = array('data' => $result, 'avg' => $res_avg, 'status' => $res_status);
            }
            else{
                $rs['msg'] = '没有数据';
                $rs['info'] = array('data' => array(), 'avg' => 0, 'status' => '安全');
                $rs['info'] = array('data' => array(), 'avg' => 0, 'status' => '绝对安全');
            }
        }
        else{