title = '咨询分类管理'; $query = $this->_query($this->table)->like('title')->equal('status'); $query->where(['is_deleted' => '0'])->order('sort desc,id desc')->page(); } /** * 添加咨询分类 * @auth true * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function add() { $this->title = '添加咨询分类'; $this->_form($this->table, 'form'); } /** * 编辑咨询分类 * @auth true * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function edit() { $this->title = '编辑咨询分类'; $this->_form($this->table, 'form'); } /** * 禁用咨询分类 * @auth true * @throws \think\Exception * @throws \think\exception\PDOException */ public function forbid() { $this->_save($this->table, ['status' => '0']); } /** * 启用咨询分类 * @auth true * @throws \think\Exception * @throws \think\exception\PDOException */ public function resume() { $this->_save($this->table, ['status' => '1']); } /** * 删除咨询分类 * @auth true * @throws \think\Exception * @throws \think\exception\PDOException */ public function remove() { $this->_delete($this->table); } }