From 450fabefe47b81858d021cfa7cab6b22f35f4adf Mon Sep 17 00:00:00 2001 From: colly_wyx <wangyixiong_007@163.com> Date: Mon, 23 Apr 2018 13:54:01 +0800 Subject: [PATCH] 修改mongodb连接 --- Yfs/Api/Data.php | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Yfs/Api/Data.php b/Yfs/Api/Data.php index 36c1ee3..95f4856 100644 --- a/Yfs/Api/Data.php +++ b/Yfs/Api/Data.php @@ -8,7 +8,7 @@ public function getRules() { return array( 'upload' => array( - 'data' => array('name' => 'data', 'type' => 'string' ,'require' => true, 'desc' => '������������'), + 'data' => array('name' => 'data', 'type' => 'array' ,'require' => true, 'desc' => '������������'), ), 'getUserDataList' => array( 'user_id' => array( @@ -60,11 +60,25 @@ if($this->start_time == $this->end_time || $data_daily_service->checkTime($this->start_time, $this->end_time)){ $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 = '������'; + } + elseif($res_avg >= 0.25 && $res_avg < 0.8){ + $res_status = '������'; + } + elseif($res_avg >= 0.8 && $res_avg < 2){ + $res_status = '������'; + } + else{ + $res_status = '������'; + } $rs['msg'] = '������������������'; - $rs['info'] = $result; + $rs['info'] = array('data' => $result, 'avg' => $res_avg, 'status' => $res_status); } else{ $rs['msg'] = '������������'; + $rs['info'] = array('data' => array(), 'avg' => 0, 'status' => '������'); } } else{ -- Gitblit v1.8.0