a
This commit is contained in:
@@ -605,7 +605,7 @@ type GetVendorCategoriesWithMapResult struct {
|
||||
CatMapID string `orm:"column(cat_map_id)" json:"catMapID"`
|
||||
}
|
||||
|
||||
func GetVendorCategoriesWithMap(db *DaoDB, vendorID int) (results []*GetVendorCategoriesWithMapResult, err error) {
|
||||
func GetVendorCategoriesWithMap(db *DaoDB, vendorID, vendorCategoryID int) (results []*GetVendorCategoriesWithMapResult, err error) {
|
||||
sql := `
|
||||
SELECT a.*, b.jd_id cat_map_id
|
||||
FROM sku_vendor_category a
|
||||
@@ -613,6 +613,10 @@ func GetVendorCategoriesWithMap(db *DaoDB, vendorID int) (results []*GetVendorCa
|
||||
WHERE vendor_id = ?
|
||||
`
|
||||
sqlParams := []interface{}{vendorID}
|
||||
if vendorCategoryID != 0 {
|
||||
sql += " AND a.vendor_category_id = ?"
|
||||
sqlParams = append(sqlParams, vendorCategoryID)
|
||||
}
|
||||
GetRows(db, &results, sql, sqlParams)
|
||||
return results, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user