This commit is contained in:
suyl
2021-05-24 14:05:01 +08:00
parent f5673437d3
commit 5fe8987522
4 changed files with 101 additions and 5 deletions

View File

@@ -576,3 +576,25 @@ func GetVendorCategoryMapExt(db *DaoDB, parentID, level, vendorID int, vendorOrg
}
return vendorMaps, err
}
func GetMtJdCategoryMap(db *DaoDB, mtID, jdID string) (cats []*model.MtJdCategoryMap, err error) {
sql := `
SELECT a.*
FROM mt_jd_category_map a
WHERE 1 = 1
`
sqlParams := []interface{}{}
if mtID != "" {
sql += " AND a.mt_id = ?"
sqlParams = append(sqlParams, mtID)
}
if jdID != "" {
sql += " AND a.jd_id = ?"
sqlParams = append(sqlParams, jdID)
}
err = GetRows(db, &cats, sql, sqlParams)
if err != nil {
return nil, err
}
return cats, err
}

View File

@@ -22,3 +22,16 @@ type VendorOrgCode struct {
AppKey string `json:"appKey"`
AppSecret string `json:"appSecret"`
}
type MtJdCategoryMap struct {
ID int `orm:"column(id)" json:"id"`
MtID string `orm:"column(mt_id)" json:"mtID"`
JdID string `orm:"column(jd_id)" json:"jdID"`
}
func (*MtJdCategoryMap) TableIndex() [][]string {
return [][]string{
[]string{"MtID", "JdID"},
}
}