Shop.php 943 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\store\controller\data;
  3. use app\store\controller\Controller;
  4. use app\store\model\store\Shop as ShopModel;
  5. class Shop extends Controller
  6. {
  7. /* @var ShopModel $model */
  8. private $model;
  9. /**
  10. * 构造方法
  11. * @throws \app\common\exception\BaseException
  12. * @throws \think\db\exception\DataNotFoundException
  13. * @throws \think\db\exception\ModelNotFoundException
  14. * @throws \think\exception\DbException
  15. */
  16. public function _initialize()
  17. {
  18. parent::_initialize();
  19. $this->model = new ShopModel;
  20. $this->view->engine->layout(false);
  21. }
  22. /**
  23. * 门店列表
  24. * @param null $status
  25. * @return mixed
  26. * @throws \think\exception\DbException
  27. */
  28. public function lists($status = null)
  29. {
  30. $list = $this->model->getList($status);
  31. return $this->fetch('list', compact('list'));
  32. }
  33. }