Sign.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 Sign extends Controller
  11. {
  12. /**
  13. * 绑定数据表
  14. * @var string
  15. */
  16. protected $table = 'StoreSign';
  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)->order('id asc')->page();
  31. }
  32. /**
  33. * 添加签到
  34. * @auth true
  35. * @menu true
  36. * @throws \think\Exception
  37. * @throws \think\db\exception\DataNotFoundException
  38. * @throws \think\db\exception\ModelNotFoundException
  39. * @throws \think\exception\DbException
  40. * @throws \think\exception\PDOException
  41. */
  42. public function add()
  43. {
  44. $this->title = '添加签到';
  45. $this->_form($this->table, 'form');
  46. }
  47. /**
  48. * 编辑签到
  49. * @auth true
  50. * @menu true
  51. * @throws \think\Exception
  52. * @throws \think\db\exception\DataNotFoundException
  53. * @throws \think\db\exception\ModelNotFoundException
  54. * @throws \think\exception\DbException
  55. * @throws \think\exception\PDOException
  56. */
  57. public function edit()
  58. {
  59. $this->title = '编辑签到';
  60. $this->_form($this->table, 'form');
  61. }
  62. /**
  63. * 删除
  64. * @auth true
  65. * @menu true
  66. * @throws \think\Exception
  67. * @throws \think\exception\PDOException
  68. */
  69. public function del()
  70. {
  71. $this->_save($this->table, ['is_deleted' => 1]);
  72. }
  73. /**
  74. * 表单数据处理
  75. * @auth true
  76. * @menu true
  77. * @param array $data
  78. */
  79. protected function _form_filter(&$data)
  80. {
  81. }
  82. }