PhonePre.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. namespace app\user\controller;
  3. use library\Controller;
  4. use think\Db;
  5. /**
  6. * 手机号前缀
  7. * Class PhonePre
  8. * @package app\store\controller
  9. */
  10. class PhonePre extends Controller
  11. {
  12. /**
  13. * 绑定数据表
  14. * @var string
  15. */
  16. protected $table = 'PhonePre';
  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)->order('id asc')->page();
  31. }
  32. /**
  33. * 数据列表处理
  34. * @auth true
  35. * @menu true
  36. * @param array $data
  37. * @throws \think\db\exception\DataNotFoundException
  38. * @throws \think\db\exception\ModelNotFoundException
  39. * @throws \think\exception\DbException
  40. */
  41. protected function _index_page_filter(&$data)
  42. {
  43. }
  44. /**
  45. * 添加
  46. * @auth true
  47. * @menu true
  48. * @throws \think\Exception
  49. * @throws \think\db\exception\DataNotFoundException
  50. * @throws \think\db\exception\ModelNotFoundException
  51. * @throws \think\exception\DbException
  52. * @throws \think\exception\PDOException
  53. */
  54. public function add()
  55. {
  56. $this->title = '添加';
  57. $this->_form($this->table, 'form');
  58. }
  59. /**
  60. * 删除
  61. * @auth true
  62. * @menu true
  63. * @throws \think\Exception
  64. * @throws \think\exception\PDOException
  65. */
  66. public function del()
  67. {
  68. $this->_save($this->table, ['is_deleted' => 1]);
  69. }
  70. /**
  71. * 删除
  72. * @auth true
  73. * @menu true
  74. * @throws \think\Exception
  75. * @throws \think\exception\PDOException
  76. */
  77. public function remove()
  78. {
  79. $this->_save($this->table, ['is_deleted' => 1]);
  80. }
  81. /**
  82. * 编辑
  83. * @auth true
  84. * @menu true
  85. * @throws \think\Exception
  86. * @throws \think\db\exception\DataNotFoundException
  87. * @throws \think\db\exception\ModelNotFoundException
  88. * @throws \think\exception\DbException
  89. * @throws \think\exception\PDOException
  90. */
  91. public function edit()
  92. {
  93. $this->title = '编辑';
  94. $this->_form($this->table, 'form');
  95. }
  96. /**
  97. * 表单数据处理
  98. * @auth true
  99. * @menu true
  100. * @param array $data
  101. */
  102. protected function _form_filter(&$data)
  103. {
  104. }
  105. }