修正minimumPrice\highestPrice查询

This commit is contained in:
平凡梦
2020-07-08 17:33:03 +08:00
parent 95c835a573
commit 988972d98b

View File

@@ -466,8 +466,6 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool
sql += " AND t4.unit_price >= ? "
sqlParams = append(sqlParams, minimumPrice)
}
globals.SugarLogger.Debug("params的值打印位置4")
globals.SugarLogger.Debug(sql)
return sql, sqlParams, err
}
@@ -486,8 +484,6 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, i
if params["actVendorID"] != nil {
actVendorID = int(utils.Interface2Int64WithDefault(params["actVendorID"], -1))
}
globals.SugarLogger.Debug("params的值打印位置")
globals.SugarLogger.Debug(params)
var highestPrice, minimumPrice float64
if params["highestPrice"] != nil {
if highestPrice, err = strconv.ParseFloat(params["highestPrice"].(string), 64); err != nil {
@@ -499,16 +495,12 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, i
delete(params, "minimumPrice")
}
}
globals.SugarLogger.Debug("params的值打印位置2")
globals.SugarLogger.Debug(params)
if !(highestPrice > 0 && highestPrice > minimumPrice) || !(highestPrice > 0) {
delete(params, "highestPrice")
}
if !(minimumPrice >= 0 && highestPrice > 0 && highestPrice > minimumPrice) || !(minimumPrice >= 0) {
delete(params, "minimumPrice")
}
globals.SugarLogger.Debug("params的值打印位置3")
globals.SugarLogger.Debug(params)
db := dao.GetDB()
sql, sqlParams, err := getGetStoresSkusBaseSQL(db, storeIDs, skuIDs, isFocus, keyword, isBySku, isAct, isHighPrice, priceType, actVendorID, params)
if err != nil {