Shop.php 1003 B

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