查询高价格商品测试

This commit is contained in:
苏尹岚
2020-02-25 11:29:34 +08:00
parent 5f2ac354e4
commit bb7d754980

View File

@@ -303,7 +303,7 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool
// model.SkuStatusNormal, // model.SkuStatusNormal,
}) })
if isHighPrice { if isHighPrice {
sql += " AND t4.unit_price > t6.mid_unit_price / IF(t3.pay_percentage < 50 , 70, t3.pay_percentage) * 1.2" sql += " AND t4.unit_price > t6.mid_unit_price / IF(t3.pay_percentage < 50 , 70, t3.pay_percentage) * 1.2 * 100"
} }
if isFocus { if isFocus {
sql += " AND ((t2.status = ? AND t1.status = ?) OR t4.status = ?)" sql += " AND ((t2.status = ? AND t1.status = ?) OR t4.status = ?)"
@@ -526,6 +526,9 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus, i
t4.status_sale_begin, t4.status_sale_end, t4.status_sale_begin, t4.status_sale_end,
t6.mid_unit_price real_mid_unit_price t6.mid_unit_price real_mid_unit_price
` + sql ` + sql
if isHighPrice {
sql += " , t4.unit_price DESC LIMIT 99"
}
var tmpList []*tGetStoresSkusInfo var tmpList []*tGetStoresSkusInfo
beginTime := time.Now() beginTime := time.Now()
fmt.Println(sql) fmt.Println(sql)