饿鲜达分类查询初尝试
This commit is contained in:
@@ -47,7 +47,7 @@ func DeleteSkuNamePlace(db *DaoDB, nameID int, placeCodes []int) (num int64, err
|
||||
return ExecuteSQL(db, sql, sqlParams...)
|
||||
}
|
||||
|
||||
func GetCategories(db *DaoDB, parentID, level int, catIDs []int) (cats []*model.SkuCategory, err error) {
|
||||
func GetCategories(db *DaoDB, parentID, level int, catIDs []int, isExd bool) (cats []*model.SkuCategory, err error) {
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM sku_category t1
|
||||
@@ -67,7 +67,11 @@ func GetCategories(db *DaoDB, parentID, level int, catIDs []int) (cats []*model.
|
||||
sql += " AND t1.level = ?"
|
||||
params = append(params, level)
|
||||
}
|
||||
sql += " ORDER BY t1.level, t1.seq"
|
||||
if isExd {
|
||||
sql += " ORDER BY t1.level, t1.exd_seq"
|
||||
} else {
|
||||
sql += " ORDER BY t1.level, t1.seq"
|
||||
}
|
||||
return cats, GetRows(db, &cats, sql, params)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user