Mark.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\data\controller\shop;
  3. use app\data\model\ShopGoodsMark;
  4. use think\admin\Controller;
  5. use think\admin\helper\QueryHelper;
  6. /**
  7. * 商品标签管理
  8. * Class Mark
  9. * @package app\data\controller\shop
  10. */
  11. class Mark extends Controller
  12. {
  13. /**
  14. * 商品标签管理
  15. * @auth true
  16. * @throws \think\db\exception\DataNotFoundException
  17. * @throws \think\db\exception\DbException
  18. * @throws \think\db\exception\ModelNotFoundException
  19. */
  20. public function index()
  21. {
  22. ShopGoodsMark::mQuery()->layTable(function () {
  23. $this->title = '商品标签管理';
  24. }, function (QueryHelper $query) {
  25. $query->like('name')->equal('status')->dateBetween('create_at');
  26. });
  27. }
  28. /**
  29. * 添加商品标签
  30. * @auth true
  31. */
  32. public function add()
  33. {
  34. ShopGoodsMark::mForm('form');
  35. }
  36. /**
  37. * 编辑商品标签
  38. * @auth true
  39. */
  40. public function edit()
  41. {
  42. ShopGoodsMark::mForm('form');
  43. }
  44. /**
  45. * 修改商品标签状态
  46. * @auth true
  47. */
  48. public function state()
  49. {
  50. ShopGoodsMark::mSave();
  51. }
  52. /**
  53. * 删除商品标签
  54. * @auth true
  55. */
  56. public function remove()
  57. {
  58. ShopGoodsMark::mDelete();
  59. }
  60. }