1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace app\synth\controller;
- use think\Controller;
- use think\Db;
- class BillType extends Controller
- {
- protected $table = 'BillType';
- /**
- * 列表
- * @auth true
- * @menu true
- * @throws \think\Exception
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- * @throws \think\exception\PDOException
- */
- public function index()
- {
- $this->title = '分类管理';
- $query = $this->_query($this->table)->where('is_deleted',0)->page(false);
- }
- /**
- * 删除
- * @auth true
- * @menu true
- * @param array $data
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- public function remove()
- {
- $this->_save($this->table, ['is_deleted' => '1']);
- }
- /**
- * 禁用
- * @auth true
- * @menu true
- * @param array $data
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- public function forbidden()
- {
- $this->_save($this->table, ['status' => '0']);
- }
- /**
- * 启用
- * @auth true
- * @menu true
- * @param array $data
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- public function enable()
- {
- $this->_save($this->table, ['status' => '1']);
- }
- }
|