request->only(['page' => 1, 'size' => 15, 'username' => '','status' => ''], 'post'); return AdminLogic::list($param); } //添加运营账号 public function add() { $param = $this->request->only(['username', 'role_id','card_id'], 'post'); $val = Validate::rule(Config::get('validate_rules.adminAdd')); if (!$val->check($param)) throw new ValidateException($val->getError()); return AdminLogic:: add($param); } //获取运营账号详情 public function read() { $id = $this->request->post('id/d', 0); return AdminLogic::read($id); } //编辑运营账号 public function edit() { $param = $this->request->only(['id', 'username', 'role_id','card_id'], 'post'); $val = Validate::rule(array_merge(['id' => 'require|number|gt:0'], Config::get('validate_rules.adminAdd'))); if (!$val->check($param)) throw new ValidateException($val->getError()); return AdminLogic::edit($param); } //删除运营账号 public function delete() { $id = $this->request->post('id/d', 0); return AdminLogic::delete($id); } //启禁用运营账号 public function status() { $param = $this->request->only(['id', 'status'], 'post'); $val = Validate::rule(Config::get('validate_rules.status')); if (!$val->check($param)) throw new ValidateException($val->getError()); return AdminLogic::status($param); } //更改密码 public function changePasswod() { $param = $this->request->only(['id', 'new_password'], 'post'); $val = Validate::rule(Config::get('validate_rules.adminChangePasswod')); if (!$val->check($param)) throw new ValidateException($val->getError()); return AdminLogic::changePasswod($param); } }