修正minimumPrice\highestPrice查询
This commit is contained in:
@@ -464,6 +464,8 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool
|
|||||||
sql += " AND t4.unit_price >= ? "
|
sql += " AND t4.unit_price >= ? "
|
||||||
sqlParams = append(sqlParams, params["minimumPrice"])
|
sqlParams = append(sqlParams, params["minimumPrice"])
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("params的值打印位置4")
|
||||||
|
globals.SugarLogger.Debug(sql)
|
||||||
return sql, sqlParams, err
|
return sql, sqlParams, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,8 +474,6 @@ func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, isHi
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, isHighPrice bool, priceType int, keyword string, isBySku, isAct bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo, err error) {
|
func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, isHighPrice bool, priceType int, keyword string, isBySku, isAct bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo, err error) {
|
||||||
globals.SugarLogger.Debug("params的值打印位置")
|
|
||||||
globals.SugarLogger.Debug(params)
|
|
||||||
if !isFocus && !isBySku && (len(storeIDs) > 1 || len(storeIDs) == 0) {
|
if !isFocus && !isBySku && (len(storeIDs) > 1 || len(storeIDs) == 0) {
|
||||||
return nil, fmt.Errorf("未关注按SkuName只能查询单店")
|
return nil, fmt.Errorf("未关注按SkuName只能查询单店")
|
||||||
}
|
}
|
||||||
@@ -484,6 +484,8 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, i
|
|||||||
if params["actVendorID"] != nil {
|
if params["actVendorID"] != nil {
|
||||||
actVendorID = int(utils.Interface2Int64WithDefault(params["actVendorID"], -1))
|
actVendorID = int(utils.Interface2Int64WithDefault(params["actVendorID"], -1))
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("params的值打印位置")
|
||||||
|
globals.SugarLogger.Debug(params)
|
||||||
var highestPrice, minimumPrice float64
|
var highestPrice, minimumPrice float64
|
||||||
if params["highestPrice"] != nil {
|
if params["highestPrice"] != nil {
|
||||||
if _, ok := params["highestPrice"].(float64); !ok {
|
if _, ok := params["highestPrice"].(float64); !ok {
|
||||||
@@ -492,6 +494,8 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, i
|
|||||||
highestPrice = params["highestPrice"].(float64)
|
highestPrice = params["highestPrice"].(float64)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("params的值打印位置1")
|
||||||
|
globals.SugarLogger.Debug(params)
|
||||||
if params["minimumPrice"] != nil {
|
if params["minimumPrice"] != nil {
|
||||||
if _, ok := params["minimumPrice"].(float64); !ok {
|
if _, ok := params["minimumPrice"].(float64); !ok {
|
||||||
delete(params, "minimumPrice")
|
delete(params, "minimumPrice")
|
||||||
@@ -499,12 +503,16 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, i
|
|||||||
minimumPrice = params["minimumPrice"].(float64)
|
minimumPrice = params["minimumPrice"].(float64)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("params的值打印位置2")
|
||||||
|
globals.SugarLogger.Debug(params)
|
||||||
if !(highestPrice > 0 && highestPrice > minimumPrice) || !(highestPrice > 0) {
|
if !(highestPrice > 0 && highestPrice > minimumPrice) || !(highestPrice > 0) {
|
||||||
delete(params, "highestPrice")
|
delete(params, "highestPrice")
|
||||||
}
|
}
|
||||||
if !(minimumPrice >= 0 && highestPrice > 0 && highestPrice > minimumPrice) || !(minimumPrice >= 0) {
|
if !(minimumPrice >= 0 && highestPrice > 0 && highestPrice > minimumPrice) || !(minimumPrice >= 0) {
|
||||||
delete(params, "minimumPrice")
|
delete(params, "minimumPrice")
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("params的值打印位置3")
|
||||||
|
globals.SugarLogger.Debug(params)
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
sql, sqlParams, err := getGetStoresSkusBaseSQL(db, storeIDs, skuIDs, isFocus, keyword, isBySku, isAct, isHighPrice, priceType, actVendorID, params)
|
sql, sqlParams, err := getGetStoresSkusBaseSQL(db, storeIDs, skuIDs, isFocus, keyword, isBySku, isAct, isHighPrice, priceType, actVendorID, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user