...
|
...
|
@@ -51,17 +51,24 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis |
|
|
|
|
|
//last := time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), time.Local)
|
|
|
//last := utils.GetDayEnd()
|
|
|
if request.StartTime == 0 {
|
|
|
|
|
|
// 请求开始时间和结束时间都为0时,默认从营销年开始统计
|
|
|
if request.StartTime == 0 && request.EndTime == 0 {
|
|
|
request.StartTime = first.Unix() * 1000
|
|
|
}
|
|
|
if request.EndTime == 0 {
|
|
|
request.EndTime = last.Unix() * 1000
|
|
|
} else if request.StartTime > 0 && request.EndTime > 0 { // 判断结束时间是否超过今天,超过今天的结束时间到今天为止
|
|
|
currentDayEnd := utils.GetDayEnd().Unix() * 1000
|
|
|
if request.EndTime >= currentDayEnd {
|
|
|
request.EndTime = currentDayEnd
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//if request.EndTime > last.Unix()*1000 {
|
|
|
// request.EndTime = last.Unix() * 1000
|
|
|
//}
|
|
|
fmt.Print("StartTime: ", request.StartTime, "\n")
|
|
|
fmt.Print("EndTime: ", request.EndTime, "\n")
|
|
|
|
|
|
var orderBetween []*domain.OrderBase
|
|
|
for i := range orderAll {
|
|
|
if orderAll[i].SaleDate.Unix() >= (request.StartTime/1000) && orderAll[i].SaleDate.Unix() < (request.EndTime/1000) {
|
...
|
...
|
@@ -159,20 +166,21 @@ func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersR |
|
|
}()
|
|
|
rsp = &protocol.DividendOrdersResponse{List: make([]*protocol.DividendOrderListItem, 0)}
|
|
|
|
|
|
endTime := utils.GetDayEnd().Unix() * 1000
|
|
|
// 判断时间是否超过今天
|
|
|
currentDayEnd := utils.GetDayEnd().Unix() * 1000
|
|
|
if request.EndTime >= currentDayEnd {
|
|
|
request.EndTime = currentDayEnd
|
|
|
}
|
|
|
|
|
|
count, orders, err = OrderDao.DividendOrders(&domain.DividendOrdersQueryOption{
|
|
|
OrderTypes: domain.UserOrderTypes(domain.Career),
|
|
|
PartnerId: request.PartnerId,
|
|
|
DetailAction: request.DetailAction,
|
|
|
DividendAction: request.DividendAction,
|
|
|
StartTime: request.StartTime,
|
|
|
//EndTime: request.EndTime,
|
|
|
EndTime: endTime,
|
|
|
Offset: request.PageIndex * request.PageSize,
|
|
|
Limit: request.PageSize,
|
|
|
//SortByUpdateTime: domain.DESC,
|
|
|
//SortByCreateTime: domain.DESC,
|
|
|
OrderTypes: domain.UserOrderTypes(domain.Career),
|
|
|
PartnerId: request.PartnerId,
|
|
|
DetailAction: request.DetailAction,
|
|
|
DividendAction: request.DividendAction,
|
|
|
StartTime: request.StartTime,
|
|
|
EndTime: request.EndTime,
|
|
|
Offset: request.PageIndex * request.PageSize,
|
|
|
Limit: request.PageSize,
|
|
|
SortBySalesTime: domain.DESC,
|
|
|
JoinWays: request.JoinWays,
|
|
|
})
|
...
|
...
|
|