diff --git a/pkg/service/cast/report.go b/pkg/service/cast/report.go index 6e1babd..2baef13 100644 --- a/pkg/service/cast/report.go +++ b/pkg/service/cast/report.go @@ -164,6 +164,21 @@ func ImportCompetitiveReportBatch(ctx *gin.Context) { temp.ArtistID = fmt.Sprint(subInfoResp.Id) temp.ArtistName = subInfoResp.Name temp.ArtistPhone = subInfoResp.TelNum + + // 这里根据 ArtistID 查询竞品报告余额 + artistID, _ := strconv.ParseUint(temp.ArtistID, 10, 64) + if _, err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeCompetitiveValue); err != nil { + if err != nil && err.Error() == e.ErrorBalanceInsufficient { + temp.Remark = "该艺人竞品报告可用次数为0" + req.Reports = append(req.Reports, temp) + continue + } + if err != nil { + temp.Remark = errors.New("查询竞品报告余额失败").Error() + req.Reports = append(req.Reports, temp) + continue + } + } } // 解析标题(C列,row[2])