按照距离远近排序

admin2年前Laravel807

   $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');


相关文章

忘记密码

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

接口返回处理

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

微信支付V3

 public static function pay($order_sn = '11111', $money = '12', $uid = 7) ...

不重复 的推荐码

public function getcode(){    do {        $code = rand(10000000, 99999...

设置项目编号

$max = Db::table('member')->max('id') ?? 0; if ($max < 100000) { $cd = $this->create...

发送公众号信息

* 发送消息 */public function tosend($openid, $title, $content, $time, $aid){    $tokens = $thi...