创建商品,自动推导分类
This commit is contained in:
@@ -50,7 +50,7 @@ func DeleteSkuNamePlace(db *DaoDB, nameID int, placeCodes []int) (num int64, err
|
||||
return ExecuteSQL(db, sql, sqlParams...)
|
||||
}
|
||||
|
||||
func GetCategoriesByName(db *DaoDB, name string) (cats []*model.SkuCategory, err error) {
|
||||
func GetCategoriesByName(db *DaoDB, name string, jdCategoryId string) (cats []*model.SkuCategory, err error) {
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM sku_category t1
|
||||
@@ -62,6 +62,11 @@ func GetCategoriesByName(db *DaoDB, name string) (cats []*model.SkuCategory, err
|
||||
sql += " AND t1.name = ?"
|
||||
params = append(params, name)
|
||||
}
|
||||
|
||||
if jdCategoryId != "" {
|
||||
sql += " AND t1.jd_category_id = ?"
|
||||
params = append(params, jdCategoryId)
|
||||
}
|
||||
return cats, GetRows(db, &cats, sql, params)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user