post(); $pageSize = request()->post('pageSize', 15); $datas = AgentService::make()->getDataList($params, $pageSize); return showJson(1010, true, $datas); } /** * 详情 * @return array */ public function info() { try { if(!$result = AgentService::make()->getInfo($this->userId)){ return showJson(1009, false); }else{ return showJson(1010, true, $result); } } catch (\Exception $exception) { $error = ['data' => $exception->getTrace(), 'err' => $exception->getMessage()]; return showJson(1046, false, $error); } } /** * 入驻 * @param AgentValidator $validator * @return array */ public function apply(AgentValidator $validator) { $params = request()->all(); $params = $validator->check($params, 'apply'); if (!is_array($params)) { return showJson($params, false); } try { if(!$result = AgentService::make()->apply($this->userId, $params)){ return showJson(AgentService::make()->getError(), false); }else{ return showJson(AgentService::make()->getError(), true, $result); } } catch (\Exception $exception) { $error = ['data' => $exception->getTrace(), 'err' => $exception->getMessage()]; return showJson(1046, false, $error); } } }