From 10dab8618ad99c405fc8f3b50093a5aaadbc1e99 Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Mon, 16 Apr 2018 14:09:19 +0800
Subject: [PATCH] 增加铃声
---
Yfs/Api/Data.php | 67 +++++++++++++++++++++++++++++++++
1 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/Yfs/Api/Data.php b/Yfs/Api/Data.php
index 05d742f..8b311c8 100644
--- a/Yfs/Api/Data.php
+++ b/Yfs/Api/Data.php
@@ -10,6 +10,18 @@
'upload' => array(
'data' => array('name' => 'data', 'type' => 'string' ,'require' => true, 'desc' => '������������'),
),
+ 'getUserDataList' => array(
+ 'user_id' => array(
+ 'name' => 'user_id', 'type' => 'string', 'require' => true, 'desc' => '������id'
+ ),
+ 'start_time' => array(
+ 'name' => 'start_time', 'type' => 'string', 'require' => true, 'desc' => '������������'
+ ),
+ 'end_time' => array(
+ 'name' => 'end_time', 'type' => 'string', 'require' => true, 'desc' => '������������'
+ )
+ ),
+
);
}
@@ -35,4 +47,59 @@
return $rs;
}
+ /**
+ * ������������
+ * @desc ������������
+ * @return string user_id ������id
+ * @return string start_time ������������
+ * @return string end_time ������������
+ */
+ public function getUserDataList(){
+ $rs = array('code' => 0, 'msg' => '', 'info' => array());
+ $data_daily_service = new Domain_DataDaily();
+ 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'] = array('data' => $result, 'avg' => $res_avg, 'status' => $res_status);
+ }
+ else{
+ $rs['msg'] = '������������';
+ $rs['info'] = array('data' => array(), 'avg' => 0, 'status' => '������');
+ }
+ }
+ else{
+ $rs['code'] = 1;
+ $rs['msg'] = '���������������������������������������������������������������������������7���';
+ }
+ return $rs;
+ }
+
+ //public function updateTime(){
+ // $data_service = new Domain_Data();
+ // $datas = $data_service->getList();
+ // foreach ($datas as $value) {
+ // $data['_id'] = $value['_id'];
+ // $data['date'] = date('Y-m-d', strtotime($value['create_time']));
+ // $data_service->updateTime($data);
+ // }
+
+ // }
+
+
+
+
}
--
Gitblit v1.8.0