BillType.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace app\synth\controller;
  3. use think\Controller;
  4. use think\Db;
  5. class BillType extends Controller
  6. {
  7. protected $table = 'BillType';
  8. /**
  9. * 列表
  10. * @auth true
  11. * @menu true
  12. * @throws \think\Exception
  13. * @throws \think\db\exception\DataNotFoundException
  14. * @throws \think\db\exception\ModelNotFoundException
  15. * @throws \think\exception\DbException
  16. * @throws \think\exception\PDOException
  17. */
  18. public function index()
  19. {
  20. $this->title = '分类管理';
  21. $query = $this->_query($this->table)->where('is_deleted',0)->page(false);
  22. }
  23. /**
  24. * 删除
  25. * @auth true
  26. * @menu true
  27. * @param array $data
  28. * @throws \think\db\exception\DataNotFoundException
  29. * @throws \think\db\exception\ModelNotFoundException
  30. * @throws \think\exception\DbException
  31. */
  32. public function remove()
  33. {
  34. $this->_save($this->table, ['is_deleted' => '1']);
  35. }
  36. /**
  37. * 禁用
  38. * @auth true
  39. * @menu true
  40. * @param array $data
  41. * @throws \think\db\exception\DataNotFoundException
  42. * @throws \think\db\exception\ModelNotFoundException
  43. * @throws \think\exception\DbException
  44. */
  45. public function forbidden()
  46. {
  47. $this->_save($this->table, ['status' => '0']);
  48. }
  49. /**
  50. * 启用
  51. * @auth true
  52. * @menu true
  53. * @param array $data
  54. * @throws \think\db\exception\DataNotFoundException
  55. * @throws \think\db\exception\ModelNotFoundException
  56. * @throws \think\exception\DbException
  57. */
  58. public function enable()
  59. {
  60. $this->_save($this->table, ['status' => '1']);
  61. }
  62. }