Browse Source

fix:获取积分余额修改

jimmyyem 6 days ago
parent
commit
c96ba1bfc3
1 changed files with 1 additions and 6 deletions
  1. 1 6
      internal/logic/dashboard/get_charts_logic.go

+ 1 - 6
internal/logic/dashboard/get_charts_logic.go

@@ -4,11 +4,9 @@ import (
 	"context"
 	"fmt"
 	"github.com/suyuan32/simple-admin-common/msg/errormsg"
-	"github.com/zeromicro/go-zero/core/errorx"
 	"math"
 	"strconv"
 	"time"
-	"wechat-api/ent"
 	"wechat-api/ent/creditbalance"
 	"wechat-api/ent/custom_types"
 	"wechat-api/ent/label"
@@ -490,10 +488,7 @@ func (l *GetChartsLogic) GetCharts(req *types.ChartsReq) (resp *types.ChartsResp
 	if req.OrganizationId != nil && *req.OrganizationId > 0 {
 		creditBalance, err := l.svcCtx.DB.CreditBalance.Query().Where(creditbalance.OrganizationID(*req.OrganizationId)).First(l.ctx)
 		if err != nil {
-			if ent.IsNotFound(err) {
-				accountBalance.Count = 0
-			}
-			return nil, errorx.NewInvalidArgumentError("获取租户积分余额失败,请重试...")
+			accountBalance.Count = 0
 		}
 		accountBalance.Count = uint64(creditBalance.Balance)
 	}