GoodsCate.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 GoodsCate extends Controller
  11. {
  12. /**
  13. * 绑定数据表
  14. * @var string
  15. */
  16. protected $table = 'StoreGoodsCate';
  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)->like('title');
  31. $query->dateBetween('create_at')->order('status desc ,sort desc , id desc')->page();
  32. }
  33. /**
  34. * 数据列表处理
  35. * @auth true
  36. * @menu true
  37. * @param array $data
  38. * @throws \think\db\exception\DataNotFoundException
  39. * @throws \think\db\exception\ModelNotFoundException
  40. * @throws \think\exception\DbException
  41. */
  42. protected function _index_page_filter(&$data)
  43. {
  44. foreach ($data as $k=>&$v){
  45. }
  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 add()
  58. {
  59. $this->title = '添加分类';
  60. $this->_form($this->table, 'from');
  61. }
  62. /**
  63. * 编辑分类
  64. * @auth true
  65. * @menu 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 edit()
  73. {
  74. $this->title = '编辑分类';
  75. $this->_form($this->table, 'from');
  76. }
  77. }