|
@@ -13,20 +13,20 @@ class Api extends Core
|
|
|
$this->checkLogin();
|
|
|
$this->shop_id = Dever::input('shop_id');
|
|
|
|
|
|
- if (!$this->shop_id) {
|
|
|
- Dever::alert('请选择门店');
|
|
|
- }
|
|
|
-
|
|
|
- $lng = Dever::input('lng');
|
|
|
- $lat = Dever::input('lat');
|
|
|
- if ($lng && $lat) {
|
|
|
- $this->shop = Dever::load('shop/lib/info')->fetch($this->shop_id, false, $lng, $lat, false);
|
|
|
- } else {
|
|
|
- $this->shop = Dever::db('shop/info')->getOne($this->shop_id);
|
|
|
- }
|
|
|
+ $this->shop = array();
|
|
|
+
|
|
|
+ if ($this->shop_id) {
|
|
|
+ $lng = Dever::input('lng');
|
|
|
+ $lat = Dever::input('lat');
|
|
|
+ if ($lng && $lat) {
|
|
|
+ $this->shop = Dever::load('shop/lib/info')->fetch($this->shop_id, false, $lng, $lat, false);
|
|
|
+ } else {
|
|
|
+ $this->shop = Dever::db('shop/info')->getOne($this->shop_id);
|
|
|
+ }
|
|
|
|
|
|
- if (!$this->shop) {
|
|
|
- Dever::alert('门店不存在');
|
|
|
+ if (!$this->shop) {
|
|
|
+ Dever::alert('门店不存在');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|