boweniac 3 месяцев назад
Родитель
Сommit
d77b546a90
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      internal/logic/dashboard/get_wxs_logic.go

+ 2 - 2
internal/logic/dashboard/get_wxs_logic.go

@@ -116,8 +116,8 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
 		var predicatesHour []predicate.UsageStatisticHour
 		if organizationId != 0 {
 			predicatesHour = append(predicatesHour, usagestatistichour.OrganizationID(organizationId))
-			predicatesHour = append(predicatesHour, usagestatistichour.BotIDIn(wxIds...))
 		}
+		predicatesHour = append(predicatesHour, usagestatistichour.BotIDIn(wxIds...))
 		predicatesHour = append(predicatesHour, usagestatistichour.Addtime(lastHourData.Addtime))
 		usageStatisticHour, err := l.svcCtx.DB.UsageStatisticHour.Query().Where(predicatesHour...).Page(l.ctx, req.Page, req.PageSize)
 		if err != nil {
@@ -150,8 +150,8 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
 		var predicatesDay []predicate.UsageStatisticDay
 		if organizationId != 0 {
 			predicatesDay = append(predicatesDay, usagestatisticday.OrganizationID(organizationId))
-			predicatesDay = append(predicatesDay, usagestatisticday.BotIDIn(wxIds...))
 		}
+		predicatesDay = append(predicatesDay, usagestatisticday.BotIDIn(wxIds...))
 		predicatesDay = append(predicatesDay, usagestatisticday.Addtime(endAddTime))
 		usageStatisticDay, err := l.svcCtx.DB.UsageStatisticDay.Query().
 			Where(predicatesDay...).Page(l.ctx, req.Page, req.PageSize)