中位价价格算法修改,乘除换一下

This commit is contained in:
苏尹岚
2020-01-13 16:43:06 +08:00
parent 8c9b4081c8
commit fa899540f9
3 changed files with 9 additions and 6 deletions

View File

@@ -574,7 +574,7 @@ func GetStorePriceScore(db *DaoDB, storeIDs, vendorIDs []int, fromScore, toScore
func GetStorePriceScoreSnapshot(db *DaoDB, snapDate time.Time) (storePriceScoreSnapshot []*model.StorePriceScoreSnapshot, err error) {
sql := `
SELECT c.store_id,ROUND(count(c.unit_price/IF(d.pay_percentage < 50 , 70, d.pay_percentage)*100 <= a.mid_unit_price or NULL)/count(*)*100,2) score
SELECT c.store_id,ROUND(count(c.unit_price * IF(d.pay_percentage < 50 , 70, d.pay_percentage) / 100 <= a.mid_unit_price or NULL)/count(*)*100,2) score
FROM price_refer_snapshot a
JOIN store_sku_bind c ON c.sku_id = a.sku_id AND c.status = ? AND c.deleted_at = ?
JOIN store d ON c.store_id = d.id AND d.city_code = a.city_code AND d.deleted_at = ? AND d.status != ?