Goods.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\store\controller\data\bargain;
  3. use app\store\controller\Controller;
  4. use app\store\model\bargain\Active as ActiveModel;
  5. /**
  6. * 商品数据控制器
  7. * Class Goods
  8. * @package app\store\controller\data
  9. */
  10. class Goods extends Controller
  11. {
  12. /**
  13. * 构造方法
  14. * @throws \app\common\exception\BaseException
  15. * @throws \think\db\exception\DataNotFoundException
  16. * @throws \think\db\exception\ModelNotFoundException
  17. * @throws \think\exception\DbException
  18. */
  19. public function _initialize()
  20. {
  21. parent::_initialize();
  22. $this->view->engine->layout(false);
  23. }
  24. /**
  25. * 商品列表
  26. * @param string $search
  27. * @return mixed
  28. * @throws \think\db\exception\DataNotFoundException
  29. * @throws \think\db\exception\ModelNotFoundException
  30. * @throws \think\exception\DbException
  31. */
  32. public function lists($search = '')
  33. {
  34. $model = new ActiveModel;
  35. $list = $model->getList($search);
  36. return $this->fetch('list', compact('list'));
  37. }
  38. }