bindbox-game/internal/api/admin/matching_audit_admin.go
win 8d1eef2f7f fix(channel): 修复渠道统计GMV重复计数和商城直购误计入
1. 排除商城直购(source_type=1):GMV和成本过滤条件从IN(1,2,3,4)改为IN(2,3,4)
2. 排除次卡免费使用订单(actual_amount=0):避免购买次卡和使用次卡双重计入GMV
   - source_type=4 一番赏使用次卡:1578单 44032元重复
   - source_type=3 对对碰使用次卡:422单 7042元重复
   - 合计去除51074元虚增GMV(29.1%)
3. 成本过滤条件同步修正:source_type IN(2,3,4),total_amount>0

修正后:GMV从175600降至124527元,毛利率从37.4%回到真实的11.8%
2026-03-16 21:41:39 +08:00

38 lines
1012 B
Go
Executable File

package admin
import (
"net/http"
"bindbox-game/internal/code"
"bindbox-game/internal/pkg/core"
)
// GetMatchingAudit 获取对对碰审计数据
// @Summary 获取对对碰审计数据
// @Description 运营通过单号查询发牌过程
// @Tags 管理端.对对碰
// @Accept json
// @Produce json
// @Security AdminAuth
// @Param order_no path string true "订单号"
// @Success 200 {object} activity.MatchingGame
// @Failure 400 {object} code.Failure
// @Router /api/admin/matching/audit/{order_no} [get]
func (h *handler) GetMatchingAudit() core.HandlerFunc {
return func(ctx core.Context) {
orderNo := ctx.Param("order_no")
if orderNo == "" {
ctx.AbortWithError(core.Error(http.StatusBadRequest, code.ParamBindError, "order_no required"))
return
}
game, err := h.activity.ReconstructMatchingGame(ctx.RequestContext(), orderNo)
if err != nil {
ctx.AbortWithError(core.Error(http.StatusInternalServerError, code.ServerError, err.Error()))
return
}
ctx.Payload(game)
}
}