|
|
|
@ -68,6 +68,32 @@ class AdminUserTeam extends BaseController |
|
|
|
return $this->renderSuccess('数据返回成功', ['list' => $list, 'total' => $total]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增用户 |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function addUser() |
|
|
|
{ |
|
|
|
$param = Request::param(); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
validate(UserValidate::class)->scene('register')->check($param); |
|
|
|
|
|
|
|
$User = new User(); |
|
|
|
$param['aid'] = 0; |
|
|
|
$result = $User->register($param); |
|
|
|
|
|
|
|
if (!$result) throw new ValidateException('代理已存在'); |
|
|
|
|
|
|
|
return $this->renderSuccess('添加成功'); |
|
|
|
} catch (ValidateException $validateException) { |
|
|
|
return $this->renderError($validateException->getMessage()); |
|
|
|
} catch (\Exception $e) { |
|
|
|
return $this->renderError('操作失败'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 编辑用户信息 |
|
|
|
*/ |
|
|
|
|