$slat = $banner_content['jd'];
$slng = $banner_content['wd'];
$sql = "select *, ROUND(6378.138*2*ASIN(SQRT(POW(SIN(($slat*PI()/180-jd*PI()/180)/2),2)+COS($slat*PI()/180)*COS(jd*PI()/180)*POW(SIN(($slng*PI()/180-wd*PI()/180)/2),2))),5) AS juli
FROM {$this->model->pre}post where status=1 HAVING juli <= 2";
$list = $this->model->query($sql);
$this->assign('list', $list);
网友评论