作者 陈志颖

fix:修复订单列表统计

... ... @@ -25,13 +25,14 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis
}()
// 事业分红统计-查询订单
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: request.PartnerId, EndTime: time.Now(), SortBySalesTime: domain.DESC, OrderTypes: domain.UserOrderTypes(domain.Career)}))
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: request.PartnerId, EndTime: utils.GetDayEnd(), SortBySalesTime: domain.DESC, OrderTypes: domain.UserOrderTypes(domain.Career)}))
if e != nil {
log.Error(e)
}
t := time.Now()
last := time.Date(t.Year(), time.December, 31, 23, 59, 59, 0, time.Local)
//last := time.Date(t.Year(), time.December, 31, 23, 59, 59, 0, time.Local)
first := time.Date(t.Year(), time.January, 1, 0, 0, 0, 0, time.Local)
last := first.AddDate(1, 0, 0)
if request.StartTime == 0 {
request.StartTime = first.Unix() * 1000
}
... ...
... ... @@ -256,7 +256,7 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
cumulativeQuantity int
)
cumulativeQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
EndTime: time.Now().Unix() * 1000,
EndTime: utils.GetDayEnd().Unix() * 1000,
OrderTypes: domain.UserOrderTypes(domain.Career),
PartnerId: request.PartnerId,
PartnerCategoryId: request.JoinWay,
... ... @@ -264,6 +264,7 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
rsp.Total = cumulativeQuantity
rsp.Timestamp = time.Now().Unix() * 1000
}
//【特殊处理2】 今天累计数量特殊处理 当前查询时间段内所有订单总数(复用rsp.Total字段)
if request.StartTime > 0 && request.EndTime > 0 {
zero := time.Time(xtime.XTime(time.Now()).DayBefore(0)).Unix()
... ... @@ -278,8 +279,7 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
todayQuantity int
)
todayQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
BeginTime: queryOption.BeginTime.Unix() * 1000,
//EndTime: time.Now().Unix() * 1000,
BeginTime: queryOption.BeginTime.Unix() * 1000,
EndTime: queryOption.EndTime.Unix() * 1000,
OrderTypes: domain.UserOrderTypes(domain.Career),
PartnerId: request.PartnerId,
... ...
... ... @@ -36,7 +36,6 @@ func StatisticsV2(header *protocol.RequestHeader, request *protocol.OrderStatist
PartnerCategoryId: catId,
})
cumulativeQuantity, cumulativeMoney, _ := OrderDao.OrderStatics(&domain.OrderStaticQuery{
//EndTime: time.Now().Unix() * 1000,
EndTime: utils.GetDayEnd().Unix() * 1000,
OrderTypes: domain.UserOrderTypes(domain.Career),
PartnerId: request.PartnerId,
... ...