当前位置:网站首页>php 根据经纬度查询距离
php 根据经纬度查询距离
2022-07-02 09:38:00 【木子李826】
$having = 'distance <= 5000'
$merch_store_info = db('merch_store')
->alias('ms')
->join('merch_cate mc','ms.cateid = mc.id','left')
->join('merch_sign sn','ms.sign_id = sn.id','left')
->where($where)
->field("ms.id,name,ms.business_time,ms.business_time_start,ms.business_time_end,ms.head_img,ms.address,ms.sales_count,mc.title as cate_name,sn.title as sign_name,sn.color,ms.lng,ms.lat,(6378.138 * 2 * asin(sqrt(pow(sin((lat * pi() / 180 - ".$lat." * pi() / 180) / 2),2) + cos(lat * pi() / 180) * cos(".$lat." * pi() / 180) * pow(sin((lng * pi() / 180 - ".$lng." * pi() / 180) / 2),2))) * 1000) as distance")
->having($having)
->order($sort)
->page($page, $pagesize)
->select();边栏推荐
- Gaode draws lines according to the track
- Skills of PLC recorder in quickly monitoring multiple PLC bits
- TIPC protocol
- Is the stock account given by qiniu business school safe? Can I open an account?
- map集合赋值到数据库
- 可昇級合約的原理-DelegateCall
- Precautions for scalable contract solution based on openzeppelin
- 【云原生】2.5 Kubernetes 核心实战(下)
- MySQL basic statement
- MTK full dump grab
猜你喜欢

webauthn——官方开发文档

Attribute acquisition method and operation notes of C # multidimensional array

What are the software product management systems? Inventory of 12 best product management tools

How does the whole network display IP ownership?

MySQL比较运算符IN问题求解

Redis exceeds the maximum memory error oom command not allowed when used memory & gt; ' maxmemory'

Iii. Système de démarrage et d'horloge à puce

ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘

Internship report skywalking distributed link tracking?

从攻击面视角,看信创零信任方案实践
随机推荐
TIPC addressing 2
Rest (XOR) position and thinking
MTK full dump grab
III Chip startup and clock system
从ros1到ros2配置的一些东西
Tidb DM alarm DM_ sync_ process_ exists_ with_ Error troubleshooting
spritejs
Is the stock account given by qiniu business school safe? Can I open an account?
对毕业季即将踏入职场的年轻人的一点建议
Solve the problem of data blank in the quick sliding page of the uniapp list
TIPC Service and Topology Tracking4
deepTools对ChIP-seq数据可视化
VS2019代码中包含中文内容导致的编译错误和打印输出乱码问题
Digital transformation takes the lead to resume production and work, and online and offline full integration rebuilds business logic
Xiao Sha's pain (double pointer
JS——每次调用从数组里面随机取一个数,且不能与上一次为同一个
Redis超出最大内存错误OOM command not allowed when used memory &gt; 'maxmemory'
Order by injection
The working day of the month is calculated from the 1st day of each month
MySQL比较运算符IN问题求解