作者 陈志颖

fix:修复订单列表统计

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