ApproveMaintainUser.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://demo.thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  12. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  13. // +----------------------------------------------------------------------
  14. namespace app\approve\controller;
  15. use app\common\constant\CommonConstant;
  16. use app\common\constant\MaintainConstant;
  17. use library\Controller;
  18. /**
  19. * 维修人员
  20. */
  21. class ApproveMaintainUser extends Controller
  22. {
  23. /**
  24. * 绑定数据表
  25. * @var string
  26. */
  27. protected $table = 'ApproveMaintainUser';
  28. /**
  29. * 控制器初始化
  30. */
  31. protected function initialize()
  32. {
  33. $this->get_type_title_list = MaintainConstant::get_type_title_list();
  34. }
  35. /**
  36. * 列表
  37. * @auth true
  38. * @menu true
  39. * @throws \think\Exception
  40. * @throws \think\db\exception\DataNotFoundException
  41. * @throws \think\db\exception\ModelNotFoundException
  42. * @throws \think\exception\DbException
  43. */
  44. public function index()
  45. {
  46. $this->title = '维修人员列表';
  47. $query = $this->_query($this->table)
  48. ->field('is_deleted',true)
  49. ->where('is_deleted', CommonConstant::IS_DELETED_0)
  50. ->like('name,mobile');
  51. $query->page();
  52. }
  53. /**
  54. * 列表数据处理
  55. * @param array $data
  56. * @throws \Exception
  57. */
  58. protected function _index_page_filter(&$data)
  59. {
  60. }
  61. /**
  62. * 启用
  63. * @auth true
  64. * @throws \think\Exception
  65. * @throws \think\exception\PDOException
  66. */
  67. public function resume()
  68. {
  69. $this->applyCsrfToken();
  70. $this->_save($this->table, ['status' => CommonConstant::STATUS_NORMAL]);
  71. }
  72. /**
  73. * 禁用
  74. * @auth true
  75. * @throws \think\Exception
  76. * @throws \think\exception\PDOException
  77. */
  78. public function forbid()
  79. {
  80. $this->applyCsrfToken();
  81. $this->_save($this->table, ['status' => CommonConstant::STATUS_FROZEN]);
  82. }
  83. /**
  84. * 删除
  85. * @auth true
  86. * @throws \think\Exception
  87. * @throws \think\exception\PDOException
  88. */
  89. public function remove()
  90. {
  91. $this->applyCsrfToken();
  92. $this->_delete($this->table);
  93. }
  94. }