AuditDesc.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. namespace app\store\controller;
  3. use library\Controller;
  4. use think\Db;
  5. /**
  6. * 审核描述管理
  7. * Class Goods
  8. * @package app\store\controller
  9. */
  10. class AuditDesc extends Controller
  11. {
  12. /**
  13. * 绑定数据表
  14. * @var string
  15. */
  16. protected $table = 'AuditDesc';
  17. /**
  18. * 审核描述管理
  19. * @auth true
  20. * @menu true
  21. * @throws \think\Exception
  22. * @throws \think\db\exception\DataNotFoundException
  23. * @throws \think\db\exception\ModelNotFoundException
  24. * @throws \think\exception\DbException
  25. * @throws \think\exception\PDOException
  26. */
  27. public function index()
  28. {
  29. $this->title = '审核描述管理';
  30. $query = $this->_query($this->table)->where('is_deleted',0)->like('title');
  31. $query->dateBetween('create_at')->order('status desc , sort desc , id desc')->page();
  32. }
  33. /**
  34. * 数据列表处理
  35. * @auth true
  36. * @menu true
  37. * @param array $data
  38. * @throws \think\db\exception\DataNotFoundException
  39. * @throws \think\db\exception\ModelNotFoundException
  40. * @throws \think\exception\DbException
  41. */
  42. protected function _index_page_filter(&$data)
  43. {
  44. }
  45. /**
  46. * 添加备注
  47. * @auth true
  48. * @menu true
  49. * @throws \think\Exception
  50. * @throws \think\db\exception\DataNotFoundException
  51. * @throws \think\db\exception\ModelNotFoundException
  52. * @throws \think\exception\DbException
  53. * @throws \think\exception\PDOException
  54. */
  55. public function add()
  56. {
  57. $this->title = '添加备注';
  58. $this->_form($this->table, 'form');
  59. }
  60. /**
  61. * 编辑分类
  62. * @auth true
  63. * @menu true
  64. * @throws \think\Exception
  65. * @throws \think\db\exception\DataNotFoundException
  66. * @throws \think\db\exception\ModelNotFoundException
  67. * @throws \think\exception\DbException
  68. * @throws \think\exception\PDOException
  69. */
  70. public function edit()
  71. {
  72. $this->title = '编辑分类';
  73. $this->_form($this->table, 'form');
  74. }
  75. /**
  76. * 禁用
  77. * @auth true
  78. * @menu true
  79. * @throws \think\Exception
  80. * @throws \think\exception\PDOException
  81. */
  82. public function forbidden()
  83. {
  84. $this->_save($this->table, ['status' => '0']);
  85. }
  86. /**
  87. * 启用
  88. * @auth true
  89. * @menu true
  90. * @throws \think\Exception
  91. * @throws \think\exception\PDOException
  92. */
  93. public function enable()
  94. {
  95. $this->_save($this->table, ['status' => 1]);
  96. }
  97. /**
  98. * 删除
  99. * @auth true
  100. * @menu true
  101. * @throws \think\Exception
  102. * @throws \think\exception\PDOException
  103. */
  104. public function del()
  105. {
  106. $this->_save($this->table, ['is_deleted' => 1]);
  107. }
  108. /**
  109. * 表单数据处理
  110. * @auth true
  111. * @menu true
  112. * @param array $data
  113. */
  114. protected function _form_filter(&$data)
  115. {
  116. }
  117. }