application/manage/controller/Member.php
public function editMember(Request $request)
    {
        $user_id = $request->param('user_id');
        if (empty($user_id)) {
            return $this->error('用户ID为空');
        }
        
        $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)
            ];
            
            // 验证
            $scene = empty($data['user_passwd']) ? 'edit_info' : 'edit_passwd';
            $res = $user_logic->validate->scene($scene)->check($data);
            if (! $res) {
                return $this->error($user_logic->validate->getError());
            }
            
            // 修改
            $user_logic->saveMember($data, $user_id);
            
            return $this->success('修改用户成功', Url::build('member/index'));
        } else {
            $this->site_title = '编辑菜单';
            $this->assign('user_id', $user_id);
            
            // 用户
            $member = $user_logic->model->get($user_id);
            $this->assign('member', $member);
            
            // 群组下拉选择
            $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();
        }
    }
public function editMember(Request $request)
    {
        $user_id = $request->param('user_id');
        if (empty($user_id)) {
            return $this->error('用户ID为空');
        }
        
        $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)
            ];
            
            // 验证
            $scene = empty($data['user_passwd']) ? 'edit_info' : 'edit_passwd';
            $res = $user_logic->validate->scene($scene)->check($data);
            if (! $res) {
                return $this->error($user_logic->validate->getError());
            }
            
            // 修改
            $user_logic->saveMember($data, $user_id);
            
            return $this->success('修改用户成功', Url::build('member/index'));
        } else {
            $this->site_title = '编辑菜单';
            $this->assign('user_id', $user_id);
            
            // 用户
            $member = $user_logic->model->get($user_id);
            $this->assign('member', $member);
            
            // 群组下拉选择
            $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();
        }
    }
编辑用户

@param Request $request
@return mixed