BillType.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. namespace app\synth\controller;
  3. use library\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. /**
  63. * 添加
  64. * @auth true
  65. * @menu true
  66. * @param array $data
  67. * @throws \think\db\exception\DataNotFoundException
  68. * @throws \think\db\exception\ModelNotFoundException
  69. * @throws \think\exception\DbException
  70. */
  71. public function add(){
  72. $this->title = '添加';
  73. $this->_form($this->table, 'form');
  74. }
  75. /**
  76. *
  77. * 编辑
  78. * @auth true
  79. * @menu true
  80. * @param array $data
  81. * @throws \think\db\exception\DataNotFoundException
  82. * @throws \think\db\exception\ModelNotFoundException
  83. * @throws \think\exception\DbException
  84. */
  85. public function edit()
  86. {
  87. $this->title = '编辑';
  88. $this->_form($this->table, 'form');
  89. }
  90. }