package budget import ( "zhiyuan/pkg/db" "github.com/gin-gonic/gin" ) type Property struct { ID int64 `json:"id" prop:"add:false"` ModeId int64 `json:"modeId" type:"int" prop:"add" search:"="` ModuleId int64 `json:"moduleId" type:"int" prop:"add" search:"="` ItemId int64 `json:"itemId" type:"int" prop:"add" search:"="` QuoteId int64 `json:"quoteId" type:"int" prop:"add" search:"="` TableId int64 `json:"tableId" type:"int" prop:"add" search:"="` RowId int64 `json:"rowId" type:"int" prop:"add" search:"="` Name string `json:"name" label:"属性名称" type:"string" prop:"add edit" search:"like"` Value string `json:"value" label:"属性值" type:"string" prop:"edit" search:"="` OrderAt int64 `json:"order_at" prop:"add:false select:false"` DeletedAt int64 `json:"deleted_at" prop:"add:false select:false"` CreatedAt int64 `json:"created_at" prop:"add:false select:false"` UpdatedAt int64 `json:"updated_at" prop:"add:false select:false"` db.BaseModel } func (Property) TableName() string { return "zy_budget_property" } func (Property) ListPrivilege(c *gin.Context, data map[string]interface{}, s *db.Select) bool { return true } func (Property) OnePrivilege(c *gin.Context, id int64) bool { return true } func (Property) AddPrivilege(c *gin.Context, data map[string]interface{}, post map[string]interface{}) error { return nil } func (Property) EditPrivilege(c *gin.Context, id int64, data map[string]interface{}, post map[string]interface{}) error { return nil } func (Property) DelPrivilege(c *gin.Context, id int64) error { return nil } func (Property) OrderField() string { return "order_at" } func (Property) Page() bool { return true } func (Property) Count() bool { return true } func findProps(modeId int64, moduleId int64, itemId int64, quoteId int64, tableId int64, rowId int64, list []Property) []Property { props := make([]Property, 0) for _, v := range list { if v.ModeId == modeId && v.ModuleId == moduleId && v.ItemId == itemId && v.QuoteId == quoteId && v.TableId == tableId && v.RowId == rowId { props = append(props, v) } } return props }