company_seller.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package crm
  2. import "hongze/fms_api/global"
  3. // CompanySellerListReq CRM销售-列表请求体
  4. type CompanySellerListReq struct {
  5. SellerType int `json:"seller_type" form:"seller_type" binding:"omitempty" description:"销售类型: 0-全部; 1-FICC; 2-权益"`
  6. }
  7. // CompanySellerList 销售列表
  8. type CompanySellerList struct {
  9. AdminId int `json:"admin_id" description:"系统用户ID"`
  10. AdminName string `json:"admin_name" description:"系统用户名称"`
  11. RealName string `json:"real_name" description:"用户真实名称"`
  12. }
  13. // GetCompanySellerByRoleCodes 通过系统用户角色码获取销售
  14. func GetCompanySellerByRoleCodes(condition string, pars []interface{}) (results []*CompanySellerList, err error) {
  15. results = make([]*CompanySellerList, 0)
  16. query := global.MYSQL["report"].
  17. Table("admin as a").
  18. Select("a.admin_id, a.admin_name, real_name").
  19. Joins("JOIN sys_role b ON a.role_id = b.role_id").
  20. Where("a.enabled = 1").
  21. Where(condition, pars...)
  22. err = query.Find(&results).Error
  23. return
  24. }
  25. // SellerAdminWithGroupTeam 系统销售(包含大小分组)
  26. type SellerAdminWithGroupTeam struct {
  27. SellerId int `json:"seller_id" description:"销售ID"`
  28. SellerName string `json:"seller_name" description:"销售名称"`
  29. GroupId int `json:"group_id" description:"分组ID"`
  30. GroupName string `json:"group_name" description:"分组名称"`
  31. TeamId int `json:"team_id" description:"小组ID"`
  32. TeamName string `json:"team_name" description:"小组名称"`
  33. DepartmentId int `json:"department_id" description:"部分ID"`
  34. }
  35. // SellerAdminWithGroupList 系统销售(包含大分组)
  36. type SellerAdminWithGroupList struct {
  37. AllList []SellerAdminWithGroupTree `json:"all_list"`
  38. FiccList []SellerAdminList `json:"ficc_list"`
  39. RaiList []SellerAdminList `json:"rai_list"`
  40. }
  41. type SellerAdminWithGroupTree struct {
  42. SellerId int `json:"seller_id"`
  43. SellerName string `json:"seller_name"`
  44. ProductId int `json:"product_id"`
  45. Selected bool `json:"selected"`
  46. Child []SellerAdminWithGroupTree `json:"child"`
  47. }
  48. type SellerAdminList struct {
  49. SellerId int `json:"seller_id"`
  50. SellerName string `json:"seller_name"`
  51. }