Goods.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\store\controller\data\sharp;
  10. use app\store\controller\Controller;
  11. use app\store\model\sharp\Goods as GoodsModel;
  12. /**
  13. * 秒杀商品数据控制器
  14. * Class Goods
  15. * @package app\store\controller\data\sharp
  16. */
  17. class Goods extends Controller
  18. {
  19. /**
  20. * 构造方法
  21. * @throws \app\common\exception\BaseException
  22. * @throws \think\db\exception\DataNotFoundException
  23. * @throws \think\db\exception\ModelNotFoundException
  24. * @throws \think\exception\DbException
  25. */
  26. public function _initialize()
  27. {
  28. parent::_initialize();
  29. $this->view->engine->layout(false);
  30. }
  31. /**
  32. * 商品列表
  33. * @param string $search
  34. * @return mixed
  35. * @throws \think\db\exception\DataNotFoundException
  36. * @throws \think\db\exception\ModelNotFoundException
  37. * @throws \think\exception\DbException
  38. */
  39. public function lists($search = '')
  40. {
  41. $model = new GoodsModel;
  42. $list = $model->getList($search);
  43. return $this->fetch('list', compact('list'));
  44. }
  45. }