当前位置:网站首页>PHP query distance according to longitude and latitude
PHP query distance according to longitude and latitude
2022-07-02 11:43:00 【Muzi plum 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();边栏推荐
- 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
- 揭露数据不一致的利器 —— 实时核对系统
- mmrotate旋转目标检测框架使用记录
- MTK full dump抓取
- String (Analog
- 基于Hardhat编写合约测试用例
- Tick Data and Resampling
- sql left join 主表限制条件写在on后面和写在where后面的区别
- JS -- take a number randomly from the array every call, and it cannot be the same as the last time
猜你喜欢

RPA进阶(二)Uipath应用实践

Verilog and VHDL signed and unsigned number correlation operations

念念不忘,必有回响 | 悬镜诚邀您参与OpenSCA用户有奖调研

PLC-Recorder快速监控多个PLC位的技巧

ESP32存储配网信息+LED显示配网状态+按键清除配网信息(附源码)

Cluster Analysis in R Simplified and Enhanced

II Stm32f407 chip GPIO programming, register operation, library function operation and bit segment operation

数字化转型挂帅复产复工,线上线下全融合重建商业逻辑

Summary of data export methods in powerbi

PYQT5+openCV项目实战:微循环仪图片、视频记录和人工对比软件(附源码)
随机推荐
Bedtools tutorial
亚马逊云科技 Community Builder 申请窗口开启
PowerBI中导出数据方法汇总
基于 Openzeppelin 的可升级合约解决方案的注意事项
Summary of flutter problems
电脑无缘无故黑屏,无法调节亮度。
Jenkins installation
Eight sorting summaries
TIPC Cluster5
PX4 Position_Control RC_Remoter引入
PYQT5+openCV项目实战:微循环仪图片、视频记录和人工对比软件(附源码)
TDSQL|就业难?腾讯云数据库微认证来帮你
RPA进阶(二)Uipath应用实践
揭露数据不一致的利器 —— 实时核对系统
高德根据轨迹画线
基于Hardhat和Openzeppelin开发可升级合约(二)
What are the methods of adding elements to arrays in JS
Native method merge word
A sharp tool for exposing data inconsistencies -- a real-time verification system
接口调试工具概论