Shop.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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;
  10. use app\store\controller\Controller;
  11. use app\store\model\store\Shop as ShopModel;
  12. class Shop extends Controller
  13. {
  14. /* @var ShopModel $model */
  15. private $model;
  16. /**
  17. * 构造方法
  18. * @throws \app\common\exception\BaseException
  19. * @throws \think\db\exception\DataNotFoundException
  20. * @throws \think\db\exception\ModelNotFoundException
  21. * @throws \think\exception\DbException
  22. */
  23. public function _initialize()
  24. {
  25. parent::_initialize();
  26. $this->model = new ShopModel;
  27. $this->view->engine->layout(false);
  28. }
  29. /**
  30. * 门店列表
  31. * @param null $status
  32. * @return mixed
  33. * @throws \think\exception\DbException
  34. */
  35. public function lists($status = null)
  36. {
  37. $list = $this->model->getList($status);
  38. return $this->fetch('list', compact('list'));
  39. }
  40. }