| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\api\controller\store;
- use app\api\controller\Controller;
- use app\api\model\store\Store as StoreModel;
- use app\common\library\easywechat\AppMp;
- use app\common\model\supplier\Supplier;
- /**
- * 门店列表
- */
- class Store extends Controller
- {
- /**
- * 门店列表
- */
- public function lists($longitude = '', $latitude = '', $url = '', $shop_supplier_id = 0)
- {
- $model = new StoreModel;
- $list = $model->getList(true, $longitude, $latitude, false, $shop_supplier_id);
- $signPackage = '';
- if($url != ''){
- $app = AppMp::getApp($this->app_id);
- $app->jssdk->setUrl($url);
- $signPackage = $app->jssdk->buildConfig(array('getLocation', 'openLocation'), false);
- }
- return $this->renderSuccess('', compact('list', 'signPackage'));
- }
- /**
- * 选择门店列表
- */
- public function choiceLists($longitude = '', $latitude = '', $url = '', $shop_supplier_id = 0)
- {
- $model = new StoreModel;
- $list = $model->getChoiceLists(true, $longitude, $latitude, false, $shop_supplier_id);
- return $this->renderSuccess('', compact('list'));
- }
- /**
- * 门店详情
- */
- public function detail($store_id)
- {
- $detail = StoreModel::detail($store_id);
- if($detail['shop_supplier_id']){
- $detail['dyLink'] = Supplier::getDyLink($detail['shop_supplier_id'], $this->app_id);
- }
- return $this->renderSuccess('', compact('detail'));
- }
- }
|