fix and add
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"tydata-server/app/main/api/internal/logic/admin_agent"
|
||||
"tydata-server/app/main/api/internal/svc"
|
||||
"tydata-server/app/main/api/internal/types"
|
||||
"tydata-server/common/result"
|
||||
"tydata-server/pkg/lzkit/validator"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func AdminGetAgentWalletHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetAgentWalletReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_agent.NewAdminGetAgentWalletLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetAgentWallet(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -132,6 +132,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
Path: "/statistics",
|
||||
Handler: admin_agent.AdminGetAgentStatisticsHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/wallet/:agent_id",
|
||||
Handler: admin_agent.AdminGetAgentWalletHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
rest.WithPrefix("/api/v1/admin/agent"),
|
||||
|
||||
@@ -2,6 +2,8 @@ package admin_agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"tydata-server/app/main/api/internal/svc"
|
||||
"tydata-server/app/main/api/internal/types"
|
||||
@@ -69,7 +71,27 @@ func (l *AdminBatchUnfreezeAgentCommissionLogic) AdminBatchUnfreezeAgentCommissi
|
||||
commission.Status = 0
|
||||
err := l.svcCtx.AgentCommissionModel.UpdateWithVersion(ctx, session, commission)
|
||||
if err != nil {
|
||||
return err
|
||||
// 如果是版本冲突错误,重新查询最新的数据后重试
|
||||
if errors.Is(err, model.ErrNoRowsUpdate) {
|
||||
latestCommission, findErr := l.svcCtx.AgentCommissionModel.FindOne(ctx, commission.Id)
|
||||
if findErr != nil {
|
||||
return findErr
|
||||
}
|
||||
// 检查状态是否已被其他操作修改
|
||||
if latestCommission.Status != 1 {
|
||||
return xerr.NewErrCodeMsg(xerr.SERVER_COMMON_ERROR, fmt.Sprintf("佣金 %d 的状态已被其他操作修改,当前状态: %d", commission.Id, latestCommission.Status))
|
||||
}
|
||||
// 重新更新状态
|
||||
latestCommission.Status = 0
|
||||
updateErr := l.svcCtx.AgentCommissionModel.UpdateWithVersion(ctx, session, latestCommission)
|
||||
if updateErr != nil {
|
||||
return updateErr
|
||||
}
|
||||
// 更新引用,使用最新的数据
|
||||
commission.Version = latestCommission.Version
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// 累加到对应代理商的钱包数据
|
||||
@@ -92,7 +114,22 @@ func (l *AdminBatchUnfreezeAgentCommissionLogic) AdminBatchUnfreezeAgentCommissi
|
||||
for _, wallet := range agentWalletMap {
|
||||
err := l.svcCtx.AgentWalletModel.UpdateWithVersion(ctx, session, wallet)
|
||||
if err != nil {
|
||||
return err
|
||||
// 如果是版本冲突错误,重新查询最新的数据后重试
|
||||
if errors.Is(err, model.ErrNoRowsUpdate) {
|
||||
latestWallet, findErr := l.svcCtx.AgentWalletModel.FindOneByAgentId(ctx, wallet.AgentId)
|
||||
if findErr != nil {
|
||||
return findErr
|
||||
}
|
||||
// 重新累加金额
|
||||
latestWallet.Balance = wallet.Balance
|
||||
latestWallet.FrozenBalance = wallet.FrozenBalance
|
||||
updateErr := l.svcCtx.AgentWalletModel.UpdateWithVersion(ctx, session, latestWallet)
|
||||
if updateErr != nil {
|
||||
return updateErr
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,19 +30,25 @@ func (l *AdminGetAgentCommissionListLogic) AdminGetAgentCommissionList(req *type
|
||||
if req.AgentId != nil {
|
||||
builder = builder.Where(squirrel.Eq{"agent_id": *req.AgentId})
|
||||
}
|
||||
if req.OrderId != nil {
|
||||
builder = builder.Where(squirrel.Eq{"order_id": *req.OrderId})
|
||||
}
|
||||
if req.Status != nil {
|
||||
builder = builder.Where(squirrel.Eq{"status": *req.Status})
|
||||
}
|
||||
|
||||
// 先查出所有product_id对应的product_name(如有product_name筛选,需反查id)
|
||||
var productIdFilter int64
|
||||
if req.ProductName != nil && *req.ProductName != "" {
|
||||
// 只支持精确匹配,如需模糊可扩展
|
||||
products, err := l.svcCtx.ProductModel.FindAll(l.ctx, l.svcCtx.ProductModel.SelectBuilder().Where(squirrel.Eq{"product_name": *req.ProductName}), "")
|
||||
// 支持模糊匹配产品名称
|
||||
products, err := l.svcCtx.ProductModel.FindAll(l.ctx, l.svcCtx.ProductModel.SelectBuilder().Where(squirrel.Like{"product_name": "%" + *req.ProductName + "%"}), "")
|
||||
if err != nil || len(products) == 0 {
|
||||
return &types.AdminGetAgentCommissionListResp{Total: 0, Items: []types.AgentCommissionListItem{}}, nil
|
||||
}
|
||||
productIdFilter = products[0].Id
|
||||
builder = builder.Where("product_id = ?", productIdFilter)
|
||||
productIds := make([]int64, 0, len(products))
|
||||
for _, p := range products {
|
||||
productIds = append(productIds, p.Id)
|
||||
}
|
||||
builder = builder.Where(squirrel.Eq{"product_id": productIds})
|
||||
}
|
||||
|
||||
list, total, err := l.svcCtx.AgentCommissionModel.FindPageListByPageWithTotal(l.ctx, builder, req.Page, req.PageSize, "create_time DESC")
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package admin_agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"tydata-server/app/main/api/internal/svc"
|
||||
"tydata-server/app/main/api/internal/types"
|
||||
"tydata-server/app/main/model"
|
||||
"tydata-server/common/xerr"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type AdminGetAgentWalletLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewAdminGetAgentWalletLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminGetAgentWalletLogic {
|
||||
return &AdminGetAgentWalletLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *AdminGetAgentWalletLogic) AdminGetAgentWallet(req *types.AdminGetAgentWalletReq) (resp *types.AdminGetAgentWalletResp, err error) {
|
||||
// 查询代理钱包信息
|
||||
wallet, err := l.svcCtx.AgentWalletModel.FindOneByAgentId(l.ctx, req.AgentId)
|
||||
if err != nil {
|
||||
if errors.Is(err, model.ErrNotFound) {
|
||||
return nil, xerr.NewErrMsg("代理钱包不存在")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp = &types.AdminGetAgentWalletResp{
|
||||
Balance: wallet.Balance,
|
||||
FrozenBalance: wallet.FrozenBalance,
|
||||
TotalEarnings: wallet.TotalEarnings,
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -28,9 +28,9 @@ func NewAdminUpdateAgentCommissionStatusLogic(ctx context.Context, svcCtx *svc.S
|
||||
}
|
||||
|
||||
func (l *AdminUpdateAgentCommissionStatusLogic) AdminUpdateAgentCommissionStatus(req *types.AdminUpdateAgentCommissionStatusReq) (resp *types.AdminUpdateAgentCommissionStatusResp, err error) {
|
||||
// 验证状态值
|
||||
if req.Status != 0 && req.Status != 1 && req.Status != 2 {
|
||||
return nil, xerr.NewErrMsg("无效的状态值,状态必须为0(已结算)、1(冻结中)或2(已取消)")
|
||||
// 验证状态值:不允许手动设置为2(已取消),只能设置为0或1
|
||||
if req.Status != 0 && req.Status != 1 {
|
||||
return nil, xerr.NewErrMsg("无效的状态值,状态必须为0(已结算)或1(冻结中)")
|
||||
}
|
||||
commission, err := l.svcCtx.AgentCommissionModel.FindOne(l.ctx, req.Id)
|
||||
if err != nil {
|
||||
@@ -41,9 +41,8 @@ func (l *AdminUpdateAgentCommissionStatusLogic) AdminUpdateAgentCommissionStatus
|
||||
}
|
||||
|
||||
// 检查状态转换是否合法
|
||||
// 0(已结算) <-> 1(冻结中):允许冻结和解冻相互转换,不涉及钱包余额
|
||||
// 1(冻结中) -> 2(已取消):允许,扣减冻结余额
|
||||
// 2(已取消):已取消的状态无法转换到其他状态
|
||||
// 0(已结算) <-> 1(冻结中):允许冻结和解冻相互转换
|
||||
// 2(已取消):已取消的状态无法转换到其他状态(由订单退款自动触发)
|
||||
if commission.Status == req.Status {
|
||||
return nil, xerr.NewErrMsg("状态未发生变化")
|
||||
}
|
||||
@@ -73,17 +72,22 @@ func (l *AdminUpdateAgentCommissionStatusLogic) AdminUpdateAgentCommissionStatus
|
||||
|
||||
// 根据状态转换更新钱包
|
||||
if originalStatus == 0 && req.Status == 1 {
|
||||
// 已结算 -> 冻结中:仅状态转换,增加冻结金额,减少钱包余额。
|
||||
// 已结算 -> 冻结中:增加冻结金额,减少钱包余额
|
||||
// 检查钱包余额是否足够
|
||||
if wallet.Balance < commission.Amount {
|
||||
return xerr.NewErrMsg("钱包余额不足,无法冻结")
|
||||
}
|
||||
wallet.FrozenBalance += commission.Amount
|
||||
wallet.Balance -= commission.Amount
|
||||
|
||||
} else if originalStatus == 1 && req.Status == 0 {
|
||||
// 冻结中 -> 已结算:仅状态转换,减少冻结金额,增加钱包余额。
|
||||
// 冻结中 -> 已结算:减少冻结金额,增加钱包余额
|
||||
// 检查冻结余额是否足够
|
||||
if wallet.FrozenBalance < commission.Amount {
|
||||
return xerr.NewErrMsg("冻结余额不足,无法解冻")
|
||||
}
|
||||
wallet.FrozenBalance -= commission.Amount
|
||||
wallet.Balance += commission.Amount
|
||||
} else if originalStatus == 1 && req.Status == 2 {
|
||||
// 冻结中 -> 已取消:减少冻结金额。
|
||||
wallet.FrozenBalance -= commission.Amount
|
||||
}
|
||||
|
||||
err = l.svcCtx.AgentWalletModel.UpdateWithVersion(ctx, session, wallet)
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
paylogic "tydata-server/app/main/api/internal/logic/pay"
|
||||
"tydata-server/app/main/api/internal/svc"
|
||||
"tydata-server/app/main/api/internal/types"
|
||||
"tydata-server/app/main/model"
|
||||
@@ -91,6 +92,9 @@ func (l *AdminRefundOrderLogic) handleAlipayRefund(order *model.Order, req *type
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 退款成功后,更新代理佣金状态并扣除钱包金额
|
||||
paylogic.HandleCommissionAndWalletDeduction(l.ctx, l.svcCtx, nil, order)
|
||||
|
||||
return &types.AdminRefundOrderResp{
|
||||
Status: model.OrderStatusRefunded,
|
||||
RefundNo: refundNo,
|
||||
@@ -121,6 +125,9 @@ func (l *AdminRefundOrderLogic) handleWechatRefund(order *model.Order, req *type
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 退款成功后,更新代理佣金状态并扣除钱包金额
|
||||
paylogic.HandleCommissionAndWalletDeduction(l.ctx, l.svcCtx, nil, order)
|
||||
|
||||
return &types.AdminRefundOrderResp{
|
||||
Status: model.OrderRefundStatusPending,
|
||||
RefundNo: refundNo,
|
||||
|
||||
@@ -58,13 +58,15 @@ func (l *GetAgentCommissionLogic) GetAgentCommission(req *types.GetCommissionReq
|
||||
if copyErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取代理佣金列表, %v", err)
|
||||
}
|
||||
// 显式设置 status 字段
|
||||
commission.Status = agentCommissionModel.Status
|
||||
product, findProductErr := l.svcCtx.ProductModel.FindOne(l.ctx, agentCommissionModel.ProductId)
|
||||
if findProductErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "获取代理佣金列表, %v", err)
|
||||
}
|
||||
commission.CreateTime = agentCommissionModel.CreateTime.Format("2006-01-02 15:04:05")
|
||||
commission.ProductName = product.ProductName
|
||||
|
||||
|
||||
// 从 order 表获取 platform_order_id
|
||||
orderModel, findOrderErr := l.svcCtx.OrderModel.FindOne(l.ctx, agentCommissionModel.OrderId)
|
||||
if findOrderErr == nil && orderModel != nil && orderModel.PlatformOrderId.Valid {
|
||||
|
||||
@@ -2,10 +2,10 @@ package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
"tydata-server/app/main/model"
|
||||
"tydata-server/common/ctxdata"
|
||||
"tydata-server/common/xerr"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
"github.com/pkg/errors"
|
||||
@@ -126,6 +126,11 @@ func calculateDirectPushReport(commissions []*model.AgentCommission, loc *time.L
|
||||
// 转换时区
|
||||
createTime := c.CreateTime
|
||||
|
||||
// 只统计非退款的佣金(status != 2)
|
||||
if c.Status == 2 {
|
||||
continue
|
||||
}
|
||||
|
||||
// 统计总量
|
||||
report.TotalCommission += c.Amount
|
||||
report.TotalReport++
|
||||
|
||||
@@ -10,12 +10,73 @@ import (
|
||||
"tydata-server/app/main/model"
|
||||
"tydata-server/common/globalkey"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/wechatpay-apiv3/wechatpay-go/services/refunddomestic"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
// HandleCommissionAndWalletDeduction 处理退款后的佣金状态更新和钱包金额扣除
|
||||
// 这是一个公共函数,可以被支付宝和微信退款逻辑共享使用
|
||||
func HandleCommissionAndWalletDeduction(ctx context.Context, svcCtx *svc.ServiceContext, session sqlx.Session, order *model.Order) error {
|
||||
// 查询非已退款的佣金
|
||||
commissionBuilder := svcCtx.AgentCommissionModel.SelectBuilder()
|
||||
commissions, commissionsErr := svcCtx.AgentCommissionModel.FindAll(ctx, commissionBuilder.Where(squirrel.And{
|
||||
squirrel.Eq{"order_id": order.Id},
|
||||
squirrel.NotEq{"status": 2}, // 只查询非已退款的佣金
|
||||
}), "")
|
||||
if commissionsErr != nil {
|
||||
logx.Errorf("查询代理佣金失败,订单ID: %d, 错误: %v", order.Id, commissionsErr)
|
||||
return nil // 返回 nil,因为佣金更新失败不应影响退款流程
|
||||
}
|
||||
|
||||
for _, commission := range commissions {
|
||||
commission.Status = 2 // 设置为已退款
|
||||
// 更新佣金状态到数据库
|
||||
var updateCommissionErr error
|
||||
if session != nil {
|
||||
updateCommissionErr = svcCtx.AgentCommissionModel.UpdateWithVersion(ctx, session, commission)
|
||||
} else {
|
||||
updateCommissionErr = svcCtx.AgentCommissionModel.UpdateWithVersion(ctx, nil, commission)
|
||||
}
|
||||
if updateCommissionErr != nil {
|
||||
logx.Errorf("更新代理佣金状态失败,佣金ID: %d, 订单ID: %d, 错误: %v", commission.Id, order.Id, updateCommissionErr)
|
||||
continue // 如果佣金状态更新失败,就不继续处理钱包
|
||||
}
|
||||
|
||||
// 处理用户钱包的金额扣除
|
||||
wallet, err := svcCtx.AgentWalletModel.FindOneByAgentId(ctx, commission.AgentId)
|
||||
if err != nil {
|
||||
logx.Errorf("查询代理钱包失败,代理ID: %d, 错误: %v", commission.AgentId, err)
|
||||
continue
|
||||
}
|
||||
|
||||
// 根据订单金额优先减少冻结金额,如果冻结金额不足则减少钱包余额
|
||||
if wallet.FrozenBalance >= order.Amount {
|
||||
// 冻结余额足够,优先减少冻结金额
|
||||
wallet.FrozenBalance -= order.Amount
|
||||
} else {
|
||||
// 冻结余额不足,先扣减所有冻结金额,再扣减余额
|
||||
remaining := order.Amount - wallet.FrozenBalance
|
||||
wallet.FrozenBalance = 0
|
||||
wallet.Balance -= remaining
|
||||
}
|
||||
|
||||
var updateWalletErr error
|
||||
if session != nil {
|
||||
updateWalletErr = svcCtx.AgentWalletModel.UpdateWithVersion(ctx, session, wallet)
|
||||
} else {
|
||||
updateWalletErr = svcCtx.AgentWalletModel.UpdateWithVersion(ctx, nil, wallet)
|
||||
}
|
||||
if updateWalletErr != nil {
|
||||
logx.Errorf("更新代理钱包失败,代理ID: %d, 错误: %v", commission.AgentId, updateWalletErr)
|
||||
continue
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type WechatPayRefundCallbackLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
@@ -72,6 +133,9 @@ func (l *WechatPayRefundCallbackLogic) handleQueryOrderRefund(orderNo string, st
|
||||
if err := l.svcCtx.OrderModel.UpdateWithVersion(ctx, session, order); err != nil {
|
||||
return errors.Wrapf(err, "更新查询订单状态失败: %s", orderNo)
|
||||
}
|
||||
|
||||
// 退款成功时,更新代理佣金状态并扣除钱包金额
|
||||
HandleCommissionAndWalletDeduction(ctx, l.svcCtx, session, order)
|
||||
}
|
||||
|
||||
// 查找最新的pending状态的退款记录
|
||||
@@ -174,7 +238,7 @@ func (l *WechatPayRefundCallbackLogic) WechatPayRefundCallback(w http.ResponseWr
|
||||
var statusDetermined bool = false
|
||||
|
||||
if notification.Status != nil {
|
||||
status = *notification.Status
|
||||
status = *notification.Status
|
||||
statusDetermined = true
|
||||
} else if notification.SuccessTime != nil && !notification.SuccessTime.IsZero() {
|
||||
// 如果Status为空但SuccessTime有值,说明退款成功
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
paylogic "tydata-server/app/main/api/internal/logic/pay"
|
||||
"tydata-server/app/main/api/internal/svc"
|
||||
"tydata-server/app/main/api/internal/types"
|
||||
"tydata-server/app/main/model"
|
||||
@@ -251,6 +252,20 @@ func (l *PaySuccessNotifyUserHandler) handleError(ctx context.Context, err error
|
||||
logx.Error(refundErr)
|
||||
return asynq.SkipRetry
|
||||
}
|
||||
// 微信退款成功,更新订单、佣金、钱包状态
|
||||
logx.Infof("微信退款成功, orderID: %d", order.Id)
|
||||
// 更新订单状态为退款
|
||||
order.Status = "refunded"
|
||||
updateOrderErr := l.svcCtx.OrderModel.UpdateWithVersion(ctx, nil, order)
|
||||
if updateOrderErr != nil {
|
||||
logx.Errorf("更新订单状态失败,订单ID: %d, 错误: %v", order.Id, updateOrderErr)
|
||||
return fmt.Errorf("更新订单状态失败: %v", updateOrderErr)
|
||||
}
|
||||
|
||||
// 使用公共函数处理佣金和钱包扣除
|
||||
paylogic.HandleCommissionAndWalletDeduction(ctx, l.svcCtx, nil, order)
|
||||
|
||||
return asynq.SkipRetry
|
||||
} else {
|
||||
refund, refundErr := l.svcCtx.AlipayService.AliRefund(ctx, order.OrderNo, order.Amount)
|
||||
if refundErr != nil {
|
||||
@@ -266,6 +281,10 @@ func (l *PaySuccessNotifyUserHandler) handleError(ctx context.Context, err error
|
||||
logx.Errorf("更新订单状态失败,订单ID: %d, 错误: %v", order.Id, updateOrderErr)
|
||||
return fmt.Errorf("更新订单状态失败: %v", updateOrderErr)
|
||||
}
|
||||
|
||||
// 使用公共函数处理佣金和钱包扣除
|
||||
paylogic.HandleCommissionAndWalletDeduction(ctx, l.svcCtx, nil, order)
|
||||
|
||||
return asynq.SkipRetry
|
||||
} else {
|
||||
logx.Errorf("支付宝退款失败:%v", refundErr)
|
||||
|
||||
@@ -227,6 +227,7 @@ type AdminGetAgentCommissionListReq struct {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
AgentId *int64 `form:"agent_id,optional"` // 代理ID(可选)
|
||||
OrderId *int64 `form:"order_id,optional"` // 订单ID(可选)
|
||||
ProductName *string `form:"product_name,optional"` // 产品名(可选)
|
||||
Status *int64 `form:"status,optional"` // 状态(可选)
|
||||
}
|
||||
@@ -350,6 +351,16 @@ type AdminGetAgentStatisticsResp struct {
|
||||
TodayAgentCount int64 `json:"today_agent_count"` // 今日新增代理数
|
||||
}
|
||||
|
||||
type AdminGetAgentWalletReq struct {
|
||||
AgentId int64 `path:"agent_id"` // 代理ID
|
||||
}
|
||||
|
||||
type AdminGetAgentWalletResp struct {
|
||||
Balance float64 `json:"balance"` // 可用余额
|
||||
FrozenBalance float64 `json:"frozen_balance"` // 冻结余额
|
||||
TotalEarnings float64 `json:"total_earnings"` // 总收益
|
||||
}
|
||||
|
||||
type AdminGetAgentWithdrawalListReq struct {
|
||||
Page int64 `form:"page"` // 页码
|
||||
PageSize int64 `form:"pageSize"` // 每页数量
|
||||
@@ -1276,6 +1287,7 @@ type Commission struct {
|
||||
OrderId string `json:"order_id"` // 订单号
|
||||
ProductName string `json:"product_name"`
|
||||
Amount float64 `json:"amount"`
|
||||
Status int64 `json:"status"` // 状态:0-已结算,1-冻结中,2-已退款
|
||||
CreateTime string `json:"create_time"`
|
||||
QueryParams map[string]interface{} `json:"query_params,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user