This commit is contained in:
suyl
2021-05-24 15:25:08 +08:00
parent d986be7cad
commit c1908dcd8f
5 changed files with 98 additions and 0 deletions

View File

@@ -598,3 +598,21 @@ func GetMtJdCategoryMap(db *DaoDB, mtID, jdID string) (cats []*model.MtJdCategor
}
return cats, err
}
type GetVendorCategoriesWithMapResult struct {
model.SkuVendorCategory
CatMapID string `orm:"column(cat_map_id)" json:"catMapID"`
}
func GetVendorCategoriesWithMap(db *DaoDB, vendorID int) (results []*GetVendorCategoriesWithMapResult, err error) {
sql := `
SELECT a.*, b.jd_id cat_map_id
FROM sku_vendor_category a
LEFT JOIN mt_jd_category_map b ON a.vendor_category_id = b.mt_id
WHERE vendor_id = ?
`
sqlParams := []interface{}{vendorID}
GetRows(db, &results, sql, sqlParams)
return results, err
}