- GetVendorCategories
This commit is contained in:
@@ -22,11 +22,11 @@ var (
|
||||
)
|
||||
|
||||
// parentID 为-1表示所有
|
||||
func GetVendorCategories(vendorID int, parentID int) (vendorCats []*model.SkuVendorCategory, err error) {
|
||||
func GetVendorCategories(vendorID int, parentID string) (vendorCats []*model.SkuVendorCategory, err error) {
|
||||
cond := map[string]interface{}{
|
||||
model.FieldVendorID: vendorID,
|
||||
}
|
||||
if parentID != -1 {
|
||||
if parentID != "-1" {
|
||||
cond[model.FieldParentID] = parentID
|
||||
}
|
||||
return vendorCats, dao.GetEntities(nil, &vendorCats, cond, false)
|
||||
|
||||
@@ -113,7 +113,7 @@ type SkuVendorCategory struct {
|
||||
Name string `orm:"size(255);index" json:"name"`
|
||||
IsLeaf int8 `json:"isLeaf"`
|
||||
Level int `json:"level"`
|
||||
ParentID string `orm:"column(parent_id);size(255);index" json:"parentID"` // 父ID,引用的是VendorCategoryID而不是ID
|
||||
ParentID string `orm:"column(parent_id);size(48);index" json:"parentID"` // 父ID,引用的是VendorCategoryID而不是ID
|
||||
}
|
||||
|
||||
func (*SkuVendorCategory) TableUnique() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user