- 展示门店商品时,在分类下,按Sku.Seq排序
This commit is contained in:
@@ -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 = `
|
||||
|
||||
Reference in New Issue
Block a user