CREATE DEFINER = 'root'@'localhost'
FUNCTION easyui.calDistance (`lng1` double, `lat1` double, `lng2` double, `lat2` double)
RETURNS int(11)
BEGIN
#第一点经纬度:lng1 lat1, 如 106.486654,29.490295
#第二点经纬度:lng2 lat2 如 106.581515,29.615467
RETURN ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((lat1 * PI() / 180 - lat2 * PI() / 180) / 2), 2) + COS(lat1 * PI() / 180) * COS(lat2 * PI() / 180) * POW(SIN((lng1 * PI() / 180 - lng2 * PI() / 180) / 2), 2))) * 1000);
END