/** *动作: 新增用户 **/ public function postAdd() { $user = new User(); $data['name'] = $_POST['name']; $data['password'] = md5($_POST['password']); $data['email'] = $_POST['email']; $data['cp_group_id'] = $_POST['cp_group_id']; $data['created_at'] = date("Y-m-d H:i:s", time()); $data['updated_at'] = date("Y-m-d H:i:s", time()); if ($user->add($data)) { $this->success('添加成功'); } $this->error('添加失败'); }
/** *动作: 新增用户 **/ public function postAdd() { $user = new User(); $data['username'] = $_POST['username']; $data['password'] = md5($_POST['password']); $data['email'] = $_POST['email']; $data['cp_group_id'] = $_POST['cp_group_id']; $data['created_at'] = date("Y-m-d H:i:s", time()); $data['updated_at'] = date("Y-m-d H:i:s", time()); if ($user->add($data)) { session('admin.success_msg', '添加成功'); //$this->success('评论成功'); $this->redirect('User/index', '', 0, ''); //$this->success('添加成功'); } $this->error('添加失败'); }