$slat = $banner_content['jd']; $slng = $banner_content['wd']; $sql = "select *, acos( sin(($slng*3.1415)/180) * sin((wd*3.1415)/180) + cos(($slng*3.1415)/180) * cos((wd*3.1415)/180) * cos(($slat*3.1415)/180 - (jd*3.1415)/180) )*6370.996 AS juli FROM {$this->model->pre}post where status=1 and cid=29 HAVING juli <= 1"; $list = $this->model->query($sql); 數據庫字段 jd 經度 wd 緯度 某點的座標 $slat 經度 $slng 緯度
更多精彩文章請關注 王明昌博客