sys_group.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package crm
  2. import (
  3. "hongze/fms_api/global"
  4. "time"
  5. )
  6. // SysGroup 系统分组表
  7. type SysGroup struct {
  8. GroupId int `gorm:"primaryKey;column:group_id;type:int(11);not null" json:"group_id"`
  9. DepartmentId int `gorm:"index:idx_department_id;column:department_id;type:int(11)" json:"department_id"` // 部门id
  10. GroupName string `gorm:"column:group_name;type:varchar(255);default:''" json:"group_name"` // 分组名称
  11. CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"create_time"`
  12. ParentId int `gorm:"column:parent_id;type:int(11);default:0" json:"parent_id"`
  13. }
  14. func (m *SysGroup) TableName() string {
  15. return "sys_group"
  16. }
  17. type SysGroupListReq struct {
  18. SellerType int `json:"seller_type" form:"seller_type" description:"销售类型:1ficc销售,2权益销售"`
  19. }
  20. func (m *SysGroup) List(condition string, pars []interface{}) (list []*SysGroup, err error) {
  21. list = make([]*SysGroup, 0)
  22. err = global.MYSQL["report"].Model(m).
  23. Where(condition, pars...).
  24. Find(&list).Error
  25. return
  26. }
  27. func (m *SysGroup) Count(condition string, pars []interface{}) (total int64, err error) {
  28. err = global.MYSQL["report"].Model(m).
  29. Where(condition, pars...).
  30. Count(&total).Error
  31. return
  32. }
  33. type AllSellerResp struct {
  34. FiccSeller []*SellerAdminWithGroupTeam
  35. RaiSeller []*SellerAdminWithGroupTeam
  36. }