当前位置:网站首页>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();边栏推荐
猜你喜欢

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

Principe du contrat évolutif - delegatecall

基于Hardhat和Openzeppelin开发可升级合约(一)

Principle of scalable contract delegatecall

Jinshanyun - 2023 Summer Internship

Develop scalable contracts based on hardhat and openzeppelin (II)

What is the relationship between digital transformation of manufacturing industry and lean production

How to Create a Nice Box and Whisker Plot in R

Always report errors when connecting to MySQL database

MTK full dump抓取
随机推荐
SSRF
R HISTOGRAM EXAMPLE QUICK REFERENCE
ctf 记录
【IDEA】使用插件一键逆向生成代码
八大排序汇总
Order by injection
ROS lacks catkin_ pkg
基于Hardhat和Openzeppelin开发可升级合约(二)
mmrotate旋转目标检测框架使用记录
Supermarket (heap overload
webauthn——官方开发文档
II Stm32f407 chip GPIO programming, register operation, library function operation and bit segment operation
Is it safe to open a stock account through the QR code of the securities manager? Or is it safe to open an account in a securities company?
tidb-dm报警DM_sync_process_exists_with_error排查
A sharp tool for exposing data inconsistencies -- a real-time verification system
TIPC introduction 1
deepTools对ChIP-seq数据可视化
Some suggestions for young people who are about to enter the workplace in the graduation season
enumrate的start属性的坑
Installation of ROS gazebo related packages