'string','companyCode'=>'string']; $this->post = $this->request->post(); //跳过验证的特殊办法 if(isset($this->request->param()['leo_debug']) && $this->request->param()['leo_debug']== 'leo'){ return true; } HelperService::diffParam($params_list,$this->post); $TokenService = new TokenService(); $res = $TokenService->checkToken($this->post); if($res !== true){ HelperService::returnJson($res); }else{ unset($this->post['token']); } } protected function returnJson($data,$code=200,$msg='success'){ HelperService::returnJson([ 'code'=>$code, 'msg'=>$msg, 'data'=>$data ]); } protected function toArray($res){ $data = []; if(!empty($res)){ foreach($res as $k=>$v){ $data[] = $res[$k]->toArray(); } } return $data ; } /** * 生成订单号 * @return string */ protected function createOrderNum(){ $key = date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 4, 5); $key.=rand(100,999); usleep(1000); return $key; } }