123456789101112131415161718192021222324252627282930313233343536 |
- package services
- import (
- "errors"
- "fmt"
- "hongze/hz_crm_api/models/company"
- "hongze/hz_crm_api/services/alarm_msg"
- )
- // 根据公司ID获取权益销售名称
- func GetSellNameMapByCompanyIds(companyIds []int) (respMap map[int]string) {
- var err error
- defer func() {
- if err != nil {
- fmt.Println(err)
- go alarm_msg.SendAlarmMsg("根据公司ID获取权益销售名称,失败:"+err.Error()+fmt.Sprint(companyIds), 2)
- }
- }()
- lenarr := len(companyIds)
- if lenarr == 0 {
- return
- }
- var pars []interface{}
- var condition string
- respMap = make(map[int]string, 0)
- condition = " AND product_id = 2 "
- list, e := company.GetCompanyProductList(condition, pars)
- if e != nil {
- err = errors.New("GetCompanyProductList, Err: " + e.Error())
- return
- }
- for _, v := range list {
- respMap[v.CompanyId] = v.SellerName
- }
- return
- }
|