按照距离远近排序

admin8个月前Laravel408

   $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 get_order_sn() {     return date('Ymd') ...

excel 导出

header("Content-Type: application/vnd.ms-excel; name='excel'"); header("Content-Disposition:atta...

用户注册账号

public function register(){    $mobile = request()->input('mobile');   &nb...

修改密码

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

获取域名

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

阿里云发送短信

public function sms(){    $moile = request()->input('mobile');    if...