/** * 增加后台用户 * * @auther yangyifan <*****@*****.**> */ public function getAdd() { return $this->html_builder->builderTitle('增加后台用户')->builderFormSchema('email', '登录邮箱', $type = 'text', $default = '', $notice = '', $class = '', $rule = 'e', $err_message = '', $option = '', $option_value_schema = '')->builderFormSchema('password', '登录密码', $type = 'password')->builderFormSchema('mobile', '手机号码', $type = 'text', $default = '', $notice = '', $class = '', $rule = 'm', $err_message = '', $option = '', $option_value_schema = '')->builderFormSchema('status', '状态', 'radio', '', '当前角色是否开启,如果关闭,则属于当前角色都不可用', '', '', '', [1 => '开启', '2' => '关闭'], '2')->builderFormSchema('face', '头像', 'image')->builderFormSchema('role_id', '所属角色', 'select', $default = '', $notice = '', $class = '', $rule = '*', $err_message = '', RoleModel::getRoleList(), 'role_name')->builderConfirmBotton('确认', url('admin/admininfo/add'), 'btn btn-success')->builderAdd(); }
/** * 删除数据 * * @param $id * @throws \Exception * @author yangyifan <*****@*****.**> */ public function getDelete($id) { RoleModel::del($id) > 0 ? $this->response(200, trans('response.delete_success'), [], false, url('admin/news/index')) : $this->response(400, trans('response.delete_error'), [], false); }
/** * 处理新增角色 * * @auther yangyifan <*****@*****.**> */ public function postAdd(RoleRequest $request) { $affected_number = RoleModel::create($request->all()); return $affected_number->id > 0 ? $this->response(200, trans('response.add_success'), [], true, url('admin/role/index')) : $this->response(400, trans('response.add_error'), [], false); }
/** * 增加论坛分类 * * @param int $id * @author yangyifan <*****@*****.**> */ public function getAdd() { return $this->html_builder->builderTitle('增加论坛分类')->builderFormSchema('cat_name', '分类名称')->builderFormSchema('keywords', '分类关键字')->builderFormSchema('description', '分类描述', 'textarea')->builderFormSchema('pid', '父级菜单', 'select', $default = '', $notice = '', $class = '', $rule = '*', $err_message = '', ForumCatModel::getAllForSchemaOption('cat_name'), 'cat_name')->builderFormSchema('status', '状态', 'radio', '', '', '', '', '', [1 => '开启', '2' => '关闭'], '1')->builderFormSchema('is_show', '是否设置为推荐', 'radio', '', '', '', '', '', [1 => '开启', '2' => '关闭'], '2')->builderFormSchema('sort', '菜单排序', 'text', 255)->builderFormSchema('access', '权限设置', 'multiSelect', $default = '', $notice = '', $class = '', $rule = '*', $err_message = '', $option = RoleModel::select('id', 'role_name')->where('status', '=', 1)->get(), $option_value_schema = [])->builderConfirmBotton('确认', url('admin/forum-cat/add'), 'btn btn-success')->builderAdd(); }