Store.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 choiceLists($longitude = '', $latitude = '', $url = '', $shop_supplier_id = 0)
  30. {
  31. $model = new StoreModel;
  32. $list = [];
  33. // $list = $model->getChoiceLists(true, $longitude, $latitude, false, $shop_supplier_id);
  34. return $this->renderSuccess('', compact('list'));
  35. }
  36. /**
  37. * 门店详情
  38. */
  39. public function detail($store_id)
  40. {
  41. $detail = StoreModel::detail($store_id);
  42. return $this->renderSuccess('', compact('detail'));
  43. }
  44. }