@@ -70,6 +70,9 @@ func InsertOrUpdateReport(list *[]Report, source string) (ids []int, err error)
orgIds = append(orgIds, report.OrgID)
}
orgIds = silce_utils.RemoveDuplicates(orgIds)
+ if orgIds == nil || len(orgIds) == 0 {
+ return
+ }
db := models.Main()
//手动事务
err = db.Select("distinct id").Where("org_id in ? and source =? ", orgIds, source).Scan(&ids).Error