作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

商品搜索

... ... @@ -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();
... ...