Member.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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\user\controller;
  15. use library\Controller;
  16. use think\Db;
  17. /**
  18. * 会员信息管理
  19. * Class Member
  20. * @package app\store\controller
  21. */
  22. class Member extends Controller
  23. {
  24. /**
  25. * 绑定数据表
  26. * @var string
  27. */
  28. protected $table = 'StoreMember';
  29. /**
  30. * 会员信息管理
  31. * @auth true
  32. * @menu true
  33. * @throws \think\Exception
  34. * @throws \think\db\exception\DataNotFoundException
  35. * @throws \think\db\exception\ModelNotFoundException
  36. * @throws \think\exception\DbException
  37. * @throws \think\exception\PDOException
  38. */
  39. public function index()
  40. {
  41. $this->title = '会员信息管理';
  42. $query = $this->_query($this->table)->where('is_deleted',0)->like('name,phone');
  43. $query->dateBetween('create_at')->order('id desc')->page();
  44. }
  45. /**
  46. * 数据列表处理
  47. * @param array $data
  48. * @throws \think\db\exception\DataNotFoundException
  49. * @throws \think\db\exception\ModelNotFoundException
  50. * @throws \think\exception\DbException
  51. */
  52. protected function _index_page_filter(&$data)
  53. {
  54. }
  55. protected function _form_filter(&$data){
  56. }
  57. /**
  58. * 编辑用户
  59. * @auth true
  60. * @throws \think\Exception
  61. * @throws \think\db\exception\DataNotFoundException
  62. * @throws \think\db\exception\ModelNotFoundException
  63. * @throws \think\exception\DbException
  64. * @throws \think\exception\PDOException
  65. */
  66. public function edit()
  67. {
  68. $this->title = '编辑用户';
  69. $this->_form($this->table, 'form');
  70. }
  71. /**
  72. * 禁用用户
  73. * @auth true
  74. * @throws \think\Exception
  75. * @throws \think\exception\PDOException
  76. */
  77. public function forbid()
  78. {
  79. $this->_save($this->table, ['status' => '0']);
  80. }
  81. /**
  82. * 启用用户
  83. * @auth true
  84. * @throws \think\Exception
  85. * @throws \think\exception\PDOException
  86. */
  87. public function resume()
  88. {
  89. $this->_save($this->table, ['status' => '1']);
  90. }
  91. }