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