maohongli
  public function  car_source_location($lng,$lat,$log){

$sql = "select a.*, ROUND(6378.138*2*ASIN(SQRT(
POW(SIN(({$lat}*PI()/180-lat*PI()/180)/2),2)
+COS({$lat}*PI()/180)
*COS(lat*PI()/180)
*POW(SIN(({$lng}*PI()/180-lng*PI()/180)/2),2)
))*1000) AS distance
FROM `tp_group` a

HAVING distance <= {$log}";

// Log::record("car_source_location: ".$sql)." -- ".time();
$group= M("group");
$location = $group->query($sql);

return $location;
}

分类:

技术点:

相关文章:

  • 2021-12-22
  • 2021-12-06
  • 2022-02-06
  • 2022-12-23
  • 2021-10-27
  • 2021-11-23
  • 2022-12-23
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2021-11-20
  • 2021-12-14
  • 2022-12-23
  • 2021-11-08
  • 2021-12-19
相关资源
相似解决方案