up
This commit is contained in:
@@ -90,10 +90,10 @@ type Store4User struct {
|
|||||||
Address string `orm:"size(255)" json:"address"`
|
Address string `orm:"size(255)" json:"address"`
|
||||||
Tel1 string `orm:"size(32);index" json:"tel1"`
|
Tel1 string `orm:"size(32);index" json:"tel1"`
|
||||||
Tel2 string `orm:"size(32);index" json:"tel2"`
|
Tel2 string `orm:"size(32);index" json:"tel2"`
|
||||||
Lng int `json:"-"` // 乘了10的6次方
|
Lng int `json:"-"` // 乘了10的6次方
|
||||||
Lat int `json:"-"` // 乘了10的6次方
|
Lat int `json:"-"` // 乘了10的6次方
|
||||||
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
|
DeliveryRangeType int8 `json:"-"` // 参见相关常量定义
|
||||||
DeliveryRange string `orm:"type(text)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon,则为逗号分隔坐标,分号分隔的坐标点(坐标与Lng和Lat一样,都是整数),比如 121361504,31189308;121420555,31150238。否则为半径,单位为米
|
DeliveryRange string `orm:"type(text)" json:"-"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon,则为逗号分隔坐标,分号分隔的坐标点(坐标与Lng和Lat一样,都是整数),比如 121361504,31189308;121420555,31150238。否则为半径,单位为米
|
||||||
|
|
||||||
FloatLng float64 `json:"lng"`
|
FloatLng float64 `json:"lng"`
|
||||||
FloatLat float64 `json:"lat"`
|
FloatLat float64 `json:"lat"`
|
||||||
@@ -2390,16 +2390,13 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi
|
|||||||
city.name city_name
|
city.name city_name
|
||||||
FROM store t1
|
FROM store t1
|
||||||
JOIN place city ON city.code = t1.city_code
|
JOIN place city ON city.code = t1.city_code
|
||||||
|
JOIN store_map sm ON sm.store_id = t1.id AND sm.vendor_id = ? AND sm.deleted_at = ? AND sm.status <> ?
|
||||||
WHERE t1.deleted_at = ? AND t1.status <> ? AND t1.lng > ? AND t1.lng < ? AND t1.lat > ? AND t1.lat < ?
|
WHERE t1.deleted_at = ? AND t1.status <> ? AND t1.lng > ? AND t1.lng < ? AND t1.lat > ? AND t1.lat < ?
|
||||||
ORDER BY t1.id
|
ORDER BY t1.id
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{
|
sqlParams := []interface{}{
|
||||||
utils.DefaultTimeValue,
|
model.VendorIDJX, utils.DefaultTimeValue, model.StoreStatusDisabled,
|
||||||
model.StoreStatusDisabled,
|
utils.DefaultTimeValue, model.StoreStatusDisabled, jxutils.StandardCoordinate2Int(lng1), jxutils.StandardCoordinate2Int(lng2), jxutils.StandardCoordinate2Int(lat1), jxutils.StandardCoordinate2Int(lat2),
|
||||||
jxutils.StandardCoordinate2Int(lng1),
|
|
||||||
jxutils.StandardCoordinate2Int(lng2),
|
|
||||||
jxutils.StandardCoordinate2Int(lat1),
|
|
||||||
jxutils.StandardCoordinate2Int(lat2),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var storeList1 []*Store4User
|
var storeList1 []*Store4User
|
||||||
|
|||||||
Reference in New Issue
Block a user