计算点的左边,若两边坐标重合也算落在里面
This commit is contained in:
@@ -2382,7 +2382,8 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi
|
|||||||
if err = dao.GetRows(dao.GetDB(), &storeList1, sql, sqlParams...); err == nil {
|
if err = dao.GetRows(dao.GetDB(), &storeList1, sql, sqlParams...); err == nil {
|
||||||
var storeList2 []*Store4User
|
var storeList2 []*Store4User
|
||||||
for _, v := range storeList1 {
|
for _, v := range storeList1 {
|
||||||
if distance := jxutils.Point2StoreDistance(lng, lat, v.Lng, v.Lat, v.DeliveryRangeType, v.DeliveryRange); distance > 0 {
|
distance := jxutils.Point2StoreDistance(lng, lat, v.Lng, v.Lat, v.DeliveryRangeType, v.DeliveryRange)
|
||||||
|
if distance > 0 || (lng == jxutils.IntCoordinate2Standard(v.Lng) && lat == jxutils.IntCoordinate2Standard(v.Lat)) {
|
||||||
v.Distance = distance
|
v.Distance = distance
|
||||||
storeList2 = append(storeList2, v)
|
storeList2 = append(storeList2, v)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user