From 4b9bdbdab8d33a9197e12cac65477018e8bdc20e Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Sat, 28 Apr 2018 17:08:52 +0800
Subject: [PATCH] 优化了平均值
---
Yfs/Api/Data.php | 39 ++++++++++++++++++++++++++++++++-------
1 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/Yfs/Api/Data.php b/Yfs/Api/Data.php
index 4293e22..bffe44c 100644
--- a/Yfs/Api/Data.php
+++ b/Yfs/Api/Data.php
@@ -11,6 +11,17 @@
'data' => array('name' => 'data', 'type' => 'string' ,'require' => false, 'source' => 'post', 'desc' => '������������'),
'data_1' => array('name' => 'data_1', 'type' => 'array' ,'require' => false, 'source' => 'post', 'desc' => '������������'),
),
+ 'originalUpload' => array(
+ 'data' => array('name' => 'data', 'type' => 'string' ,'require' => false, 'source' => 'post', 'desc' => '������������'),
+ 'data_1' => array('name' => 'data_1', 'type' => 'array' ,'require' => false, 'source' => 'post', 'desc' => '������������'),
+ 'user_id' => array(
+ 'name' => 'user_id', 'type' => 'string', 'require' => true, 'desc' => '������id'
+ ),
+ 'time' => array(
+ 'name' => 'time', 'type' => 'string', 'require' => true, 'desc' => '������'
+ ),
+
+ ),
'getUserDataList' => array(
'user_id' => array(
'name' => 'user_id', 'type' => 'string', 'require' => true, 'desc' => '������id'
@@ -37,7 +48,7 @@
$data_service = new Domain_Data();
if(!empty($this->data)){
- $data = $this->data;
+ $data = json_decode($this->data,true);
}
else{
$data = $this->data_1;
@@ -60,6 +71,20 @@
}
/**
+ * ������������������
+ * @return [type] [description]
+ */
+ public function originalUpload(){
+ $rs = array('code' => 0, 'msg' => '');
+ $data_service = new Domain_Data();
+ if($data_service->originalUpload($this))
+ $rs['msg'] = "������������������������";
+ else
+ $rs['msg'] = "������������������������";
+ return $rs;
+ }
+
+ /**
* ������������
* @desc ������������
* @return string user_id ������id
@@ -73,17 +98,17 @@
$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);
--
Gitblit v1.8.0