Goods.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 Goods extends Controller
  22. {
  23. /**
  24. * 绑定数据表
  25. * @var string
  26. */
  27. protected $table = 'Goods';
  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. foreach ($data as &$value) {
  61. }
  62. }
  63. /**
  64. * 添加
  65. * @auth true
  66. * @throws \think\Exception
  67. * @throws \think\db\exception\DataNotFoundException
  68. * @throws \think\db\exception\ModelNotFoundException
  69. * @throws \think\exception\DbException
  70. * @throws \think\exception\PDOException
  71. */
  72. public function add()
  73. {
  74. $this->title = '添加';
  75. $this->_form($this->table, 'form');
  76. }
  77. /**
  78. * 编辑
  79. * @auth true
  80. * @throws \think\Exception
  81. * @throws \think\db\exception\DataNotFoundException
  82. * @throws \think\db\exception\ModelNotFoundException
  83. * @throws \think\exception\DbException
  84. * @throws \think\exception\PDOException
  85. */
  86. public function edit()
  87. {
  88. $this->title = '编辑';
  89. $this->_form($this->table, 'form');
  90. }
  91. /**
  92. * 表单处理
  93. * @param array $data
  94. * @throws \think\db\exception\DataNotFoundException
  95. * @throws \think\db\exception\ModelNotFoundException
  96. * @throws \think\exception\DbException
  97. */
  98. protected function _form_filter(&$data)
  99. {
  100. if ($this->request->isGet()) {
  101. }
  102. if ($this->request->isPost()) {
  103. }
  104. }
  105. /**
  106. * 删除
  107. * @auth true
  108. * @throws \think\Exception
  109. * @throws \think\exception\PDOException
  110. */
  111. public function remove()
  112. {
  113. $this->applyCsrfToken();
  114. $this->_delete($this->table);
  115. }
  116. }