Shop.php 846 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\model\store\Shop as ShopModel;
  4. /**
  5. * 门店列表
  6. * Class Shop
  7. * @package app\api\controller
  8. */
  9. class Shop extends Controller
  10. {
  11. /**
  12. * 门店列表
  13. * @param string $longitude
  14. * @param string $latitude
  15. * @return array
  16. * @throws \think\exception\DbException
  17. */
  18. public function lists($longitude = '', $latitude = '')
  19. {
  20. $model = new ShopModel;
  21. $list = $model->getList(true, $longitude, $latitude);
  22. return $this->renderSuccess(compact('list'));
  23. }
  24. /**
  25. * 门店详情
  26. * @param $shop_id
  27. * @return array
  28. * @throws \think\exception\DbException
  29. */
  30. public function detail($shop_id)
  31. {
  32. $detail = ShopModel::detail($shop_id);
  33. return $this->renderSuccess(compact('detail'));
  34. }
  35. }