尝试解决商城topskus重复问题
This commit is contained in:
@@ -967,6 +967,7 @@ func GetStoreSkusByNameIDs(db *DaoDB, storeIDs []int, nameID int) (skuList []*St
|
|||||||
|
|
||||||
func GetTopSkusByStoreIDs(db *DaoDB, storeIDs []int) (storeSkuNameExt []*StoreSkuNameExt, err error) {
|
func GetTopSkusByStoreIDs(db *DaoDB, storeIDs []int) (storeSkuNameExt []*StoreSkuNameExt, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
|
SELECT DISTINCT t1.* FROM(
|
||||||
SELECT 1 s, t1.count, t2.id sku_id, t3.*, t1.store_id, t1.store_name
|
SELECT 1 s, t1.count, t2.id sku_id, t3.*, t1.store_id, t1.store_name
|
||||||
FROM(
|
FROM(
|
||||||
SELECT SUM(b.count) count,c.id,a.store_id,d.name store_name
|
SELECT SUM(b.count) count,c.id,a.store_id,d.name store_name
|
||||||
@@ -1017,7 +1018,7 @@ func GetTopSkusByStoreIDs(db *DaoDB, storeIDs []int) (storeSkuNameExt []*StoreSk
|
|||||||
AND a.status = ?
|
AND a.status = ?
|
||||||
AND a.deleted_at = ?
|
AND a.deleted_at = ?
|
||||||
AND (d.type = ? OR d.type = ?)
|
AND (d.type = ? OR d.type = ?)
|
||||||
ORDER BY 1,2 DESC
|
ORDER BY 1,2 DESC) t1
|
||||||
LIMIT ?
|
LIMIT ?
|
||||||
`
|
`
|
||||||
sqlParams = append(sqlParams, model.StoreSkuBindStatusNormal, utils.DefaultTimeValue, model.ActSkuDirectDown, model.ActSkuSecKill, 30)
|
sqlParams = append(sqlParams, model.StoreSkuBindStatusNormal, utils.DefaultTimeValue, model.ActSkuDirectDown, model.ActSkuSecKill, 30)
|
||||||
|
|||||||
Reference in New Issue
Block a user