|
@@ -63,9 +63,14 @@ func (e *Event) ExceptionNums(c *dto.EventExceptionNumsReq, result *[]dto.EventE
|
|
|
if c.EndTime > 0 {
|
|
|
db.Where("created_at<?", time.Unix(c.EndTime, 0).Format(time.DateTime))
|
|
|
}
|
|
|
- appIds := c.GetAppIds()
|
|
|
- if len(appIds) > 0 {
|
|
|
- db.Where("app_id IN ?", appIds)
|
|
|
+ appAliases := c.GetAppAliases()
|
|
|
+ if len(appAliases) > 0 {
|
|
|
+ db.Where("app_alias in ?", appAliases)
|
|
|
+ } else { // 兼容旧逻辑, 后期去掉
|
|
|
+ appIds := c.GetAppIds()
|
|
|
+ if len(appIds) > 0 {
|
|
|
+ db.Where("app_id IN ?", appIds)
|
|
|
+ }
|
|
|
}
|
|
|
if err := db.Group("app_id").Find(result).Count(count).Error; err != nil {
|
|
|
return errors.Wrap(err, "执行查询应用异常数量失败")
|