|
@@ -91,9 +91,13 @@ class ActivityController extends HomeBaseController |
|
@@ -91,9 +91,13 @@ class ActivityController extends HomeBaseController |
91
|
$wx = new \WeChatCommon();
|
91
|
$wx = new \WeChatCommon();
|
92
|
if(empty(session('user.city'))) {
|
92
|
if(empty(session('user.city'))) {
|
93
|
$pos = Db:: name('user')->field('lat,lng')->where(['id' => session('user.id')])->find();
|
93
|
$pos = Db:: name('user')->field('lat,lng')->where(['id' => session('user.id')])->find();
|
94
|
- $return = json_decode(anti_analysis($pos['lat'], $pos['lng']), true);
|
|
|
95
|
- $city = $return['result']['address_component']['city'];
|
|
|
96
|
- session('user.city', $city);
|
94
|
+ if(empty($pos['lat']) || empty($pos['lng'])) {
|
|
|
95
|
+
|
|
|
96
|
+ }else {
|
|
|
97
|
+ $return = json_decode(anti_analysis($pos['lat'], $pos['lng']), true);
|
|
|
98
|
+ $city = $return['result']['address_component']['city'];
|
|
|
99
|
+ session('user.city', $city);
|
|
|
100
|
+ }
|
97
|
}
|
101
|
}
|
98
|
return $this->fetch(':_list', [
|
102
|
return $this->fetch(':_list', [
|
99
|
'result' => $result,
|
103
|
'result' => $result,
|