code: public function addMember(Request $request)
      {
          $user_logic = MemberLogic::instance();
          if ($request->isPost()) {
              $data = [
                  'user_name' => $request->param('user_name'),
                  'user_nick' => $request->param('user_nick'),
                  'user_passwd' => $request->param('user_passwd'),
                  're_passwd' => $request->param('re_passwd'),
                  'group_id' => $request->param('group_id'),
                  'user_status' => $request->param('user_status', 0)
              ];
              
              // 验证
              $res = $user_logic->validate->scene('add')->check($data);
              if (! $res) {
                  return $this->error($user_logic->validate->getError());
              }
              
              // 添加
              $user_logic->addMember($data);
              
              return $this->success('添加用户成功', Url::build('member/index'));
          } else {
              $this->site_title = '新增用户';
              
              // 群组下拉选择
              $member_group = MemberGroupLogic::instance()->getGroupSelect();
              $this->assign('member_group', $member_group);
              
              // 用户状态
              $user_status = $user_logic->userStatus();
              $this->assign('user_status', $user_status);
              
              return $this->fetch();
          }
      }
docs: 添加用户
  
  @param Request $request
  @return mixed