- 展示门店商品时,在分类下,按Sku.Seq排序

This commit is contained in:
gazebo
2019-08-30 18:41:44 +08:00
parent 3e7b07fc9e
commit 5e0f93a1c8

View File

@@ -346,6 +346,10 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo
panic(r)
}
}()
catOrderBy := ""
if params["categoryID"] != nil {
catOrderBy = "t2.seq, "
}
skuNamesInfo = &StoreSkuNamesInfo{}
if !isBySku && sqlPageSize < 1000 {
@@ -372,18 +376,15 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, isFocus bo
sql += " OR (t1.id = ? AND t3.id = ?)"
sqlParams = append(sqlParams, v.NameID, v.StoreID)
}
sql += `)
ORDER BY t3.id, t2.name_id, t2.id
`
sql += fmt.Sprintf(`)
ORDER BY %s t3.id, t2.name_id, t2.id`, catOrderBy)
} else {
if isFocus {
sql += `
ORDER BY t3.id, t2.name_id, t2.id
`
sql += fmt.Sprintf(`
ORDER BY %s t3.id, t2.name_id, t2.id`, catOrderBy)
}
sql += `
LIMIT ? OFFSET ?
`
LIMIT ? OFFSET ?`
sqlParams = append(sqlParams, sqlParamsPage)
}
sql = `