我正在wordpress中创建所有用户的列表。为此,我将WP\\u User\\u Query与meta\\u Query结合使用,以便只显示筛选过的用户。我想在SELECT中添加自定义查询过滤器,但遇到了问题
p.distance_unit
* DEGREES(ACOS(COS(RADIANS(p.latpoint))
* COS(RADIANS(mt30.meta_value ))
* COS(RADIANS(p.longpoint) - RADIANS(mt31.meta_value))
+ SIN(RADIANS(p.latpoint))
* SIN(RADIANS(mt30.meta_value)))) AS distance
和自定义联接
SELECT \'.$_REQUEST[\'user_lat\'].\' AS latpoint, \'.$_REQUEST[\'user_long\'].\' AS longpoint,
\'.$_REQUEST[\'geo-radius\'].\'.0 AS radius, 111.045 AS distance_unit
) AS p ON 1=1
还有一个习惯
AND (mt30.meta_value
BETWEEN p.latpoint - (p.radius / p.distance_unit)
AND p.latpoint + (p.radius / p.distance_unit)
AND mt31.meta_value
BETWEEN p.longpoint - (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint))))
AND p.longpoint + (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint)))))
和海关拥有条款
having distance < $_REQUEST[\'geo-radius\']
我知道如何为帖子添加查询过滤器,但我无法为用户添加查询过滤器
请指导我或任何参考url。
谢谢