get_type_title_list = MaintainConstant::get_type_title_list(); } /** * 列表 * @auth true * @menu true * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function index() { $this->title = '商品分类列表'; $query = $this->_query($this->table) ->field('is_deleted', true) ->where('is_deleted',CommonConstant::IS_DELETED_0) ->order('sort desc,id asc'); $query->page(false); } /** * 列表数据处理 * @param array $data * @throws \Exception */ protected function _index_page_filter(&$data) { if($data) { foreach ($data as &$vo) { $vo['ids'] = join(',', Data::getArrSubIds($data, $vo['id'])); } $data = Data::arr2table($data); } } /** * 添加 * @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'); } /** * 表单处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ protected function _form_filter(&$data) { if ($this->request->isGet()) { $this->cate_list = GoodsCategoryService::get_list([]); } if ($this->request->isPost()) { } } /** * 删除 * @auth true * @throws \think\Exception * @throws \think\exception\PDOException */ public function remove() { $this->applyCsrfToken(); $this->_delete($this->table); } }