Store.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\api\controller\store;
  3. use app\api\controller\Controller;
  4. use app\api\model\store\Store as StoreModel;
  5. use app\common\library\easywechat\AppMp;
  6. /**
  7. * 门店列表
  8. */
  9. class Store extends Controller
  10. {
  11. /**
  12. * 门店列表
  13. */
  14. public function lists($longitude = '', $latitude = '', $url = '', $shop_supplier_id = 0)
  15. {
  16. $model = new StoreModel;
  17. $list = $model->getList(true, $longitude, $latitude, false, $shop_supplier_id);
  18. $signPackage = '';
  19. if($url != ''){
  20. $app = AppMp::getApp($this->app_id);
  21. $app->jssdk->setUrl($url);
  22. $signPackage = $app->jssdk->buildConfig(array('getLocation', 'openLocation'), false);
  23. }
  24. return $this->renderSuccess('', compact('list', 'signPackage'));
  25. }
  26. /**
  27. * 门店详情
  28. */
  29. public function detail($store_id)
  30. {
  31. $detail = StoreModel::detail($store_id);
  32. return $this->renderSuccess('', compact('detail'));
  33. }
  34. }