From 066fffc3e2d8107df55dd41d4d50dbe5b69886b1 Mon Sep 17 00:00:00 2001 From: colly_wyx <wangyixiong_007@163.com> Date: Sat, 28 Apr 2018 10:22:40 +0800 Subject: [PATCH] 解决上传原始数据接口bug --- Yfs/Api/Data.php | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Yfs/Api/Data.php b/Yfs/Api/Data.php index 97cce4e..cc47faf 100644 --- a/Yfs/Api/Data.php +++ b/Yfs/Api/Data.php @@ -14,6 +14,13 @@ '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( @@ -41,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; @@ -70,19 +77,11 @@ public function originalUpload(){ $rs = array('code' => 0, 'msg' => ''); $data_service = new Domain_Data(); - - if(!empty($this->data)){ - $data = $this->data; - } - else{ - $data = $this->data_1; - } - - if(count($data) > 0){ - - $data_service->originalUpload($data); - $rs['msg'] = "������������������������"; - } + if($data_service->originalUpload($this)) + $rs['msg'] = "������������������������"; + else + $rs['msg'] = "������������������������"; + return $rs; } /** -- Gitblit v1.8.0