aa
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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"},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user