user = $this->getUser(); // 用户信息 } /** * 提交分销商申请 */ public function submit() { $data = $this->postData(); if (empty($data['name']) || empty($data['mobile'])) { throw new BaseException(['msg' => '用户名或者手机号为空']); } $model = new AgentApplyModel; if ($model->submit($this->user, $data)) { return $this->renderSuccess('成功'); } return $this->renderError($model->getError() ?: '提交失败'); } /* *获取分销商协议 */ public function getAgreement() { $model = new Setting(); $data = $model->getItem('license'); return $this->renderSuccess('', compact('data')); } }