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

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

@@ -107,9 +107,12 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn
return result, err
}
for _, v := range storeList {
if v.PayPercentage < 50 {
continue
}
var tList []*tStoreSkuBindAndSkuName
sql := `
SELECT DISTINCT b.city_code, a.store_id, Round(a.unit_price/IF(b.pay_percentage < 50 , 70, b.pay_percentage) * 100) AS unit_price, c.name_id
SELECT DISTINCT b.city_code, a.store_id, Round(a.unit_price * IF(b.pay_percentage < 50 , 70, b.pay_percentage) / 100) AS unit_price, c.name_id
FROM store_sku_bind a
JOIN store b ON b.id = a.store_id AND b.deleted_at = ? AND b.status != ?
JOIN sku c ON c.id = a.sku_id