前缀修改

This commit is contained in:
苏尹岚
2020-05-22 17:51:42 +08:00
parent bca3a4e8d9
commit 7c4c652e5a
2 changed files with 7 additions and 10 deletions

View File

@@ -2492,7 +2492,6 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi
_, lat2 := jxutils.ConvertDistanceToLogLat(lng, lat, float64(maxRadius), 0)
lng1 := lng - (lng2 - lng)
lat1 := lat - (lat2 - lat)
fmt.Println("test33", lng1, lng2, lat1, lat2)
// globals.SugarLogger.Debugf("%f,%f,%f,%f\n", lng1, lng2, lat1, lat2)
sql := `
SELECT t1.*,
@@ -2509,13 +2508,11 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi
utils.DefaultTimeValue, model.StoreStatusDisabled, jxutils.StandardCoordinate2Int(lng1), jxutils.StandardCoordinate2Int(lng2), jxutils.StandardCoordinate2Int(lat1), jxutils.StandardCoordinate2Int(lat2),
model.YES,
}
fmt.Println("test22", sqlParams)
var storeList1 []*Store4User
if err = dao.GetRows(dao.GetDB(), &storeList1, sql, sqlParams...); err == nil {
var storeList2 []*Store4User
for _, v := range storeList1 {
distance := jxutils.Point2StoreDistance(lng, lat, v.Lng, v.Lat, v.DeliveryRangeType, v.DeliveryRange)
fmt.Println("test11111", distance, 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
storeList2 = append(storeList2, v)

View File

@@ -246,7 +246,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
syncType = "更新商品"
}
for i, storeSku := range storeSkuList {
isNeedUpdatePrice := isCreate //storeSku.SkuSyncStatus&( model.SyncFlagPriceMask| model.SyncFlagNewMask) != 0
// isNeedUpdatePrice := isCreate //storeSku.SkuSyncStatus&( model.SyncFlagPriceMask| model.SyncFlagNewMask) != 0
foodData := make(map[string]interface{})
foodDataList[i] = foodData
foodData[mtwmapi.KeyAppFoodCode] = utils.Int2Str(storeSku.SkuID)
@@ -258,9 +258,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
foodData["skus"] = skus
foodData["name"] = utils.LimitUTF8StringLen(utils.FilterEmoji(storeSku.SkuName), mtwmapi.MaxSkuNameCharCount)
foodData["description"] = storeSku.Comment
if isNeedUpdatePrice {
foodData["price"] = jxutils.IntPrice2Standard(storeSku.VendorPrice)
}
// if isNeedUpdatePrice {
foodData["price"] = jxutils.IntPrice2Standard(storeSku.VendorPrice)
// }
foodData["min_order_count"] = 1
foodData["unit"] = storeSku.Unit
foodData["box_num"] = 1
@@ -291,9 +291,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
// foodData["tag_id"] = utils.Int64ToStr(defVendorCatID)
}
skus[0]["spec"] = jxutils.ComposeSkuSpec(storeSku.SpecQuality, storeSku.SpecUnit)
if isNeedUpdatePrice {
skus[0]["price"] = foodData["price"]
}
// if isNeedUpdatePrice {
skus[0]["price"] = foodData["price"]
// }
skus[0]["stock"] = stockCount2Mtwm(model.MaxStoreSkuStockQty)
if storeSku.Upc != "" {
skus[0]["upc"] = storeSku.Upc