正在显示
5 个修改的文件
包含
11 行增加
和
9 行删除
@@ -24,7 +24,7 @@ func DividendStatistics(header *protocol.RequestHeader, request *protocol.Divide | @@ -24,7 +24,7 @@ func DividendStatistics(header *protocol.RequestHeader, request *protocol.Divide | ||
24 | defer func() { | 24 | defer func() { |
25 | transactionContext.RollbackTransaction() | 25 | transactionContext.RollbackTransaction() |
26 | }() | 26 | }() |
27 | - _, orderAll, e := OrderResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: header.UserId, EndTime: time.Now(), SortByCreateTime: domain.DESC})) | 27 | + _, orderAll, e := OrderResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: header.UserId, EndTime: time.Now(), SortByCreateTime: domain.DESC, OrderType: domain.OrderReal})) |
28 | if e != nil { | 28 | if e != nil { |
29 | log.Error(e) | 29 | log.Error(e) |
30 | } | 30 | } |
@@ -143,6 +143,7 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques | @@ -143,6 +143,7 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques | ||
143 | if request.EndTime > 0 { | 143 | if request.EndTime > 0 { |
144 | queryOption.EndTime = time.Unix(request.EndTime/1000, 0) | 144 | queryOption.EndTime = time.Unix(request.EndTime/1000, 0) |
145 | } | 145 | } |
146 | + queryOption.OrderType = request.OrderType | ||
146 | _, orders, _ = OrderResponsitory.Find(utils.ObjectJsonToMap(queryOption)) | 147 | _, orders, _ = OrderResponsitory.Find(utils.ObjectJsonToMap(queryOption)) |
147 | //统计数据 | 148 | //统计数据 |
148 | if request.PageIndex == 0 { | 149 | if request.PageIndex == 0 { |
@@ -105,7 +105,11 @@ func (m *Order) OrderBonusReceive() float64 { | @@ -105,7 +105,11 @@ func (m *Order) OrderBonusReceive() float64 { | ||
105 | 105 | ||
106 | //订单未收分红 | 106 | //订单未收分红 |
107 | func (m *Order) OrderBonusWait() float64 { | 107 | func (m *Order) OrderBonusWait() float64 { |
108 | - return m.OrderTotalBonus() - m.OrderBonusReceive() | 108 | + bonusWait := m.OrderTotalBonus() - m.OrderBonusReceive() |
109 | + if bonusWait < 0 { | ||
110 | + return 0 | ||
111 | + } | ||
112 | + return bonusWait | ||
109 | } | 113 | } |
110 | 114 | ||
111 | //分红支出 | 115 | //分红支出 |
@@ -24,9 +24,11 @@ func CheckJWTToken(ctx *context.Context) { | @@ -24,9 +24,11 @@ func CheckJWTToken(ctx *context.Context) { | ||
24 | ctx.Output.JSON(msg, false, false) | 24 | ctx.Output.JSON(msg, false, false) |
25 | } | 25 | } |
26 | }() | 26 | }() |
27 | - if _, err := utils.ParseJWTToken(token); err != nil { | 27 | + if u, err := utils.ParseJWTToken(token); err != nil { |
28 | msg = protocol.NewMesage(4141) | 28 | msg = protocol.NewMesage(4141) |
29 | return | 29 | return |
30 | + } else { | ||
31 | + ctx.Input.SetData("UserId", u.UserId) | ||
30 | } | 32 | } |
31 | return | 33 | return |
32 | } | 34 | } |
@@ -18,7 +18,7 @@ func CreateRequstLogFilter(logger *logs.BeeLogger) func(ctx *context.Context) { | @@ -18,7 +18,7 @@ func CreateRequstLogFilter(logger *logs.BeeLogger) func(ctx *context.Context) { | ||
18 | if ctx.Input.GetData("requestBody") != nil { | 18 | if ctx.Input.GetData("requestBody") != nil { |
19 | body = string(ctx.Input.GetData("requestBody").([]byte)) | 19 | body = string(ctx.Input.GetData("requestBody").([]byte)) |
20 | } | 20 | } |
21 | - logger.Debug(fmt.Sprintf("====>Recv RequestId:%s BodyData:%s \n Header:%v", requestId, body, ctx.Request.Header)) | 21 | + logger.Debug(fmt.Sprintf("====>Recv User:%v RequestId:%s BodyData:%s", ctx.Input.GetData("UserId"), requestId, body)) |
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
@@ -43,10 +43,5 @@ func CreateRequestBodyFilter() func(ctx *context.Context) { | @@ -43,10 +43,5 @@ func CreateRequestBodyFilter() func(ctx *context.Context) { | ||
43 | ctx.Input.SetData("requestBody", body) | 43 | ctx.Input.SetData("requestBody", body) |
44 | ctx.Request.Body.Close() | 44 | ctx.Request.Body.Close() |
45 | } | 45 | } |
46 | - //if len(ctx.Input.RequestBody) == 0 { | ||
47 | - // | ||
48 | - //} else { | ||
49 | - // ctx.Input.SetData("requestBody", ctx.Input.RequestBody) | ||
50 | - //} | ||
51 | } | 46 | } |
52 | } | 47 | } |
-
请 注册 或 登录 后发表评论