...
|
...
|
@@ -24,13 +24,13 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis |
|
|
}()
|
|
|
|
|
|
// 事业分红统计-查询订单
|
|
|
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: request.PartnerId, EndTime: time.Now(), SortByCreateTime: domain.DESC, OrderTypes: domain.UserOrderTypes(domain.Career)}))
|
|
|
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: request.PartnerId, EndTime: time.Now(), SortBySalesTime: domain.DESC, OrderTypes: domain.UserOrderTypes(domain.Career)}))
|
|
|
if e != nil {
|
|
|
log.Error(e)
|
|
|
}
|
|
|
var orderBetween []*domain.OrderBase
|
|
|
for i := range orderAll {
|
|
|
if orderAll[i].CreateTime.Unix() >= (request.StartTime/1000) && orderAll[i].CreateTime.Unix() < (request.EndTime/1000) {
|
|
|
if orderAll[i].SaleDate.Unix() >= (request.StartTime/1000) && orderAll[i].SaleDate.Unix() < (request.EndTime/1000) {
|
|
|
orderBetween = append(orderBetween, orderAll[i])
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -59,6 +59,9 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis |
|
|
Receivable: bonusAll.Receivable,
|
|
|
Quarters: bonusQuarters,
|
|
|
}
|
|
|
if request.PageIndex == 0 {
|
|
|
rsp.Timestamp = time.Now().Unix() * 1000
|
|
|
}
|
|
|
|
|
|
err = transactionContext.CommitTransaction()
|
|
|
return
|
...
|
...
|
@@ -82,7 +85,7 @@ func QuartersBonusStatics(orders []*domain.OrderBase, action int) (bonus []proto |
|
|
bonus = make([]protocol.Bonus, 4)
|
|
|
for i := range orders {
|
|
|
o := orders[i]
|
|
|
quarter := quarter(o.CreateTime)
|
|
|
quarter := quarter(o.SaleDate)
|
|
|
static := o.OrderBonusStatic()
|
|
|
bonus[quarter].Receivable = utils.Decimal(bonus[quarter].Receivable + static.OrderTotalReceivable())
|
|
|
bonus[quarter].Received = utils.Decimal(bonus[quarter].Received + static.OrderBonusReceive())
|
...
|
...
|
@@ -124,17 +127,18 @@ func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersR |
|
|
rsp = &protocol.DividendOrdersResponse{List: make([]*protocol.DividendOrderListItem, 0)}
|
|
|
|
|
|
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,
|
|
|
Offset: request.PageIndex * request.PageSize,
|
|
|
Limit: request.PageSize,
|
|
|
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,
|
|
|
//SortByUpdateTime: domain.DESC,
|
|
|
SortByCreateTime: domain.DESC,
|
|
|
JoinWays: request.JoinWays,
|
|
|
//SortByCreateTime: domain.DESC,
|
|
|
SortBySalesTime: domain.DESC,
|
|
|
JoinWays: request.JoinWays,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return
|
...
|
...
|
|