按照距离远近排序

admin2年前Laravel660

   $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 qrcode($uid){    require_once base_path() . '/public/phpqrcode/phpqrco...

关注公众号并登录

/* * 服务端生成带唯一标识二维码并将唯一标识返回给前端 */ public function wx_code() { $scene_str = $this->get_...

小程序的二维码

    public function qrcode()    {        $qcode = "http...

base64 处理图片

public function images(){    $image = request()->input('image');    i...

不重复 的推荐码

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

压缩图片

public static function size($id, $img) { try { list($width, $height, $img_type, $attr) = @getimages...