按照距离远近排序

admin2年前Laravel628

   $distance = "ACOS(SIN(( $lat * 3.1415) / 180 ) *SIN((lat * 3.1415) / 180 ) +COS(( $lat* 3.1415) / 180 ) * COS((lat * 3.1415) / 180 ) *COS(( $lng* 3.1415) / 180 - (lng * 3.1415) / 180 ) ) * 6380";

                    $info = $info->addSelect('*', DB::raw($distance . ' as distance'))->orderByRaw('`distance` ASC');


相关文章

查找下级所有数据

public function bottom($mid = 3){    $members = DB::select('select id,parent_id,`level...

获取域名

/** * 获取域名 */public function domain(){    return request()->getSchemeAndHttpHost();}...

修改密码

/** * 修改密码 */publicfunction setpass(){    $type = request()->input('type');// 1...

接口返回处理

public function __construct()    {        $action = request()->rout...

忘记密码

publicfunction forget(){    $phone = request()->input('phone');    $c...

批量处理数据

   public function index44()    {        $domain = request(...