TP中根据坐标计算距离并排序分页
list($lng,$lat) = explode(',',$map['location']);
$EARTH=6378.137; //地球半径
$PI=3.1415926535898; //PI值
unset($map['location']);
//work_lat、work_lng 代表数据库中存储的位置
$package_list=$this->where($map)
->field("*,(2 * $EARTH* ASIN(SQRT(POW(SIN($PI*(".$lat."-work_lat)/360),2)+COS($PI*".$lat."/180)* COS(work_lat * $PI/180)*POW(SIN($PI*(".$lng."-work_lng)/360),2)))) as juli")
->order('juli asc')
->paginate(10);