package services import ( "hongze/hongze_mfyx/models" "hongze/hongze_mfyx/utils" ) // 获取 报告精选,本周研究汇总、上周纪要汇总Pv 阅读数据 func GetCygxReportHistoryRecordListMap(articleIds []int, reportType string) (mapPv map[int]int) { var err error defer func() { if err != nil { go utils.SendAlarmMsg("获取产品内测的阅读数据,信息失败,Err:"+err.Error(), 3) } }() lenArr := len(articleIds) if lenArr == 0 { return } var condition string var pars []interface{} condition = ` AND article_id IN (` + utils.GetOrmInReplace(lenArr) + `) AND report_type = ?` pars = append(pars, articleIds, reportType) list, e := models.GetCygxReportHistoryRecordListPv(condition, pars) if e != nil && e.Error() != utils.ErrNoRow() { return } mapPv = make(map[int]int, 0) for _, v := range list { mapPv[v.ArticleId] = v.Pv } return }