作者 yangfu

日志修改/订单统计修改/订单详情修改

... ... @@ -24,7 +24,7 @@ func DividendStatistics(header *protocol.RequestHeader, request *protocol.Divide
defer func() {
transactionContext.RollbackTransaction()
}()
_, orderAll, e := OrderResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: header.UserId, EndTime: time.Now(), SortByCreateTime: domain.DESC}))
_, orderAll, e := OrderResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: header.UserId, EndTime: time.Now(), SortByCreateTime: domain.DESC, OrderType: domain.OrderReal}))
if e != nil {
log.Error(e)
}
... ...
... ... @@ -143,6 +143,7 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques
if request.EndTime > 0 {
queryOption.EndTime = time.Unix(request.EndTime/1000, 0)
}
queryOption.OrderType = request.OrderType
_, orders, _ = OrderResponsitory.Find(utils.ObjectJsonToMap(queryOption))
//统计数据
if request.PageIndex == 0 {
... ...
... ... @@ -105,7 +105,11 @@ func (m *Order) OrderBonusReceive() float64 {
//订单未收分红
func (m *Order) OrderBonusWait() float64 {
return m.OrderTotalBonus() - m.OrderBonusReceive()
bonusWait := m.OrderTotalBonus() - m.OrderBonusReceive()
if bonusWait < 0 {
return 0
}
return bonusWait
}
//分红支出
... ...
... ... @@ -24,9 +24,11 @@ func CheckJWTToken(ctx *context.Context) {
ctx.Output.JSON(msg, false, false)
}
}()
if _, err := utils.ParseJWTToken(token); err != nil {
if u, err := utils.ParseJWTToken(token); err != nil {
msg = protocol.NewMesage(4141)
return
} else {
ctx.Input.SetData("UserId", u.UserId)
}
return
}
... ...
... ... @@ -18,7 +18,7 @@ func CreateRequstLogFilter(logger *logs.BeeLogger) func(ctx *context.Context) {
if ctx.Input.GetData("requestBody") != nil {
body = string(ctx.Input.GetData("requestBody").([]byte))
}
logger.Debug(fmt.Sprintf("====>Recv RequestId:%s BodyData:%s \n Header:%v", requestId, body, ctx.Request.Header))
logger.Debug(fmt.Sprintf("====>Recv User:%v RequestId:%s BodyData:%s", ctx.Input.GetData("UserId"), requestId, body))
}
}
... ... @@ -43,10 +43,5 @@ func CreateRequestBodyFilter() func(ctx *context.Context) {
ctx.Input.SetData("requestBody", body)
ctx.Request.Body.Close()
}
//if len(ctx.Input.RequestBody) == 0 {
//
//} else {
// ctx.Input.SetData("requestBody", ctx.Input.RequestBody)
//}
}
}
... ...