平台物料分类
This commit is contained in:
15
business/model/dao/dao_matter.go
Normal file
15
business/model/dao/dao_matter.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
func GetVendorMatterCategory(db *DaoDB, vendorID int) (vendorMatterCat []*model.VendorMatterCategory, err error) {
|
||||
sql := `
|
||||
SELECT * FROM vendor_matter_catgory WHERE deleted_at = ? AND vendor_id = ?
|
||||
`
|
||||
sqlParams := []interface{}{utils.DefaultTimeValue, vendorID}
|
||||
err = GetRows(db, &vendorMatterCat, sql, sqlParams)
|
||||
return vendorMatterCat, err
|
||||
}
|
||||
17
business/model/matter.go
Normal file
17
business/model/matter.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
type VendorMatterCategory struct {
|
||||
ModelIDCULD
|
||||
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
CategoryID int `orm:"column(category_id)" json:"categoryID"`
|
||||
CategoryName string `json:"categoryName"`
|
||||
ParentID int `orm:"column(parent_id)" json:"parentID"`
|
||||
Level int `json:"level"`
|
||||
}
|
||||
|
||||
func (v *VendorMatterCategory) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"VendorID", "CategoryID"},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user