|
@@ -13,8 +13,6 @@ import (
|
|
|
"wechat-api/ent/usagestatisticday"
|
|
|
"wechat-api/ent/usagestatistichour"
|
|
|
"wechat-api/ent/wx"
|
|
|
- "wechat-api/internal/utils/dberrorhandler"
|
|
|
-
|
|
|
"wechat-api/internal/svc"
|
|
|
"wechat-api/internal/types"
|
|
|
|
|
@@ -86,7 +84,7 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
|
|
|
wxs, err := l.svcCtx.DB.Wx.Query().Where(predicates...).All(l.ctx)
|
|
|
|
|
|
if err != nil {
|
|
|
- return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
+ return nil, nil
|
|
|
}
|
|
|
|
|
|
resp = &types.WxResp{}
|
|
@@ -114,7 +112,7 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
|
|
|
Order(ent.Desc(usagestatistichour.FieldAddtime)).
|
|
|
First(l.ctx)
|
|
|
if err != nil {
|
|
|
- return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
+ return nil, nil
|
|
|
}
|
|
|
if lastHourData == nil {
|
|
|
return nil, err
|
|
@@ -128,10 +126,9 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
|
|
|
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 {
|
|
|
- return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
+ return nil, nil
|
|
|
}
|
|
|
if usageStatisticHour != nil && usageStatisticHour.List != nil {
|
|
|
- l.Infof("----------------usageStatisticHour 1--------------: %+v", usageStatisticHour)
|
|
|
resp.Data.Total = usageStatisticHour.PageDetails.Total
|
|
|
for _, hourData := range usageStatisticHour.List {
|
|
|
if wxSet[hourData.BotID] != nil {
|
|
@@ -168,7 +165,6 @@ func (l *GetWxsLogic) GetWxs(req *types.WxReq) (resp *types.WxResp, err error) {
|
|
|
return nil, err
|
|
|
}
|
|
|
if usageStatisticDay != nil && usageStatisticDay.List != nil {
|
|
|
- l.Infof("----------------usageStatisticDay 2--------------: %+v", usageStatisticDay)
|
|
|
resp.Data.Total = usageStatisticDay.PageDetails.Total
|
|
|
for _, dayData := range usageStatisticDay.List {
|
|
|
if wxSet[dayData.BotID] != nil {
|