| | |
| | | public function upload(){ |
| | | $rs = array('code' => 0, 'msg' => ''); |
| | | $data_service = new Domain_Data(); |
| | | $data = json_decode($this->data, true); |
| | | //$data = json_decode($this->data, true); |
| | | //print_r(count($data['data']));die(); |
| | | if(json_last_error() == JSON_ERROR_NONE){ |
| | | //if(json_last_error() == JSON_ERROR_NONE){ |
| | | if(count($this->data) > 0){ |
| | | $data_service->upload($data); |
| | | $rs['msg'] = "数据上报成功"; |
| | | } |
| | | else{ |
| | | $rs['code'] = 1; |
| | | $rs['msg'] = "json格式异常"; |
| | | } |
| | | // } |
| | | // else{ |
| | | // $rs['code'] = 1; |
| | | // $rs['msg'] = "json格式异常"; |
| | | // } |
| | | return $rs; |
| | | } |
| | | |