...
|
...
|
@@ -270,6 +270,17 @@ class Goods extends Frontend |
|
|
}else{
|
|
|
$data = $data->select();
|
|
|
}
|
|
|
foreach($data as $key => $vo){
|
|
|
//计算距离
|
|
|
$distance = 0;
|
|
|
if(!empty($param['lng']) && !empty($param['lat'])){
|
|
|
$distance = distance($param,$vo);
|
|
|
if($distance <= 50){
|
|
|
$ids[] = $vo['id'];
|
|
|
}
|
|
|
}
|
|
|
$data[$key]['distance'] = $distance;
|
|
|
}
|
|
|
}
|
|
|
$user_id = $this->auth->id;
|
|
|
$userModel = new \app\index\model\User();
|
...
|
...
|
|