- fixed bug in ReadStore where not set lng and lat correctly.

This commit is contained in:
gazebo
2018-10-30 19:22:32 +08:00
parent 1bdb67864d
commit 0d0e609c66
2 changed files with 16 additions and 14 deletions

View File

@@ -229,7 +229,9 @@ func GetVendorStore(ctx *jxcontext.Context, vendorStoreID string, vendorID int)
result, err2 := handler.ReadStore(vendorStoreID)
if err = err2; err == nil {
retVal = &StoreExt{
Store: *result,
Store: *result,
FloatLng: jxutils.IntCoordinate2Standard(result.Lng),
FloatLat: jxutils.IntCoordinate2Standard(result.Lat),
}
db := dao.GetDB()
if city, err2 := dao.GetPlaceByCode(db, result.CityCode); err2 == nil {

View File

@@ -109,20 +109,20 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
"stationAddress": store.Address,
"serviceTimeStart1": JxOperationTime2JdOperationTime(store.OpenTime1),
"serviceTimeEnd1": JxOperationTime2JdOperationTime(store.CloseTime1),
// "deliveryRangeType": store.DeliveryRangeType,
"coordinateType": 3, // 一直用高德
"lng": jxutils.IntCoordinate2Standard(store.Lng),
"lat": jxutils.IntCoordinate2Standard(store.Lat),
"city": store.JdCityCode,
"county": store.JdDistrictCode,
"phone": store.Tel1,
"mobile": store.Tel2,
"deliveryRangeType": store.DeliveryRangeType,
"coordinateType": 3, // 一直用高德
"lng": jxutils.IntCoordinate2Standard(store.Lng),
"lat": jxutils.IntCoordinate2Standard(store.Lat),
"city": store.JdCityCode,
"county": store.JdDistrictCode,
"phone": store.Tel1,
"mobile": store.Tel2,
}
if store.DeliveryRangeType == model.DeliveryRangeTypePolygon {
params["coordinatePoints"] = store.DeliveryRange
} else {
params["deliveryRangeRadius"] = utils.Str2Int64(store.DeliveryRange)
}
// if store.DeliveryRangeType == model.DeliveryRangeTypePolygon {
// params["coordinatePoints"] = store.DeliveryRange
// } else {
// params["deliveryRangeRadius"] = utils.Str2Int64(store.DeliveryRange)
// }
openTime2 := JxOperationTime2JdOperationTime(store.OpenTime2)
if openTime2 != 0 {