错误提示,门店评分修改

This commit is contained in:
苏尹岚
2019-12-12 13:38:06 +08:00
parent 4a4342def0
commit 19704b74bc
12 changed files with 86 additions and 65 deletions

View File

@@ -1033,18 +1033,18 @@ func RefershStoreSkusMidPrice(db *DaoDB, storeIDs []int) (count int64, err error
UPDATE store_sku_bind a
JOIN store d ON d.id = a.store_id
JOIN price_refer_snapshot b ON a.sku_id = b.sku_id AND b.snapshot_at = ? AND d.city_code = b.city_code
SET a.price = b.mid_price*100
SET a.price = (b.mid_price*IF(d.pay_percentage=0,100,d.pay_percentage))/100
WHERE 1=1
`
sqlParams := []interface{}{
utils.DefaultTimeValue,
utils.Time2Date(time.Now().AddDate(0, 0, -1)),
}
if len(storeIDs) > 0 {
sql += " AND a.store_id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
sqlParams = append(sqlParams, storeIDs)
}
sql += `
AND a.price > b.mid_price*100
AND (a.price/IF(d.pay_percentage=0,100,d.pay_percentage))*100 > b.mid_price
AND a.deleted_at = ?
AND a.status = ?
`