作者 lihan
1 个管道 的构建 通过 耗费 0 秒

自动定位功能

... ... @@ -49,11 +49,11 @@ class ActivityController extends HomeBaseController
require_once EXTEND_PATH . '/WeChatCommon.php';
$wx = new \WeChatCommon();
$pos = Db:: name('user')->field('lat,lng')->where(['id'=>session('user.id')])->find();
print_r(anti_analysis($pos['lat'], $pos['lng']));
$return = json_decode(anti_analysis($pos['lat'], $pos['lng']), true);
return $this->fetch(':_list', [
'result' => $result,
'js_sdk' => $wx->js_sdk(),
'city' => anti_analysis($pos['lat'], $pos['lng'])
'city' => $return['result']['address_component']['city']
]);
}
}
... ...
... ... @@ -40,7 +40,7 @@
<header>
<span class="left">
<i class="iconfont icon-dizhi"></i>
<span class="area" >天津</span>
<span class="area" >{$city}</span>
</span>
<form action="{:url('Activity/_list')}" method="GET">
<span class="shu">
... ...