作者 yangfu

1.分红统计修改

... ... @@ -87,6 +87,7 @@ func SmsCode(request *protocol.SmsCodeRequest) (rsp *protocol.SmsCodeResponse, e
log.Error(err, data, request.Phone)
return
}
err = protocol.NewSuccessWithMessage("发送验证码成功")
return
}
... ...
... ... @@ -75,7 +75,7 @@ func QuartersBonusStatics(orders []*domain.Order, action int) (bonus []protocol.
bonus[quarter].Outstanding += o.OrderBonusWait()
}
if action == protocol.BonusOutstanding {
bonus[quarter].Outstanding += o.OrderBonusOutstanding()
bonus[quarter].Expend += o.OrderBonusOutstanding()
}
}
return
... ... @@ -100,6 +100,7 @@ func DividendOrders(header *protocol.RequestHeader, request *protocol.DividendOr
rsp = &protocol.DividendOrdersResponse{List: make([]*protocol.DividendOrderListItem, 0)}
count, orders, err = OrderDao.DividendOrders(&domain.DividendOrdersQueryOption{
PartnerId: header.UserId,
DetailAction: request.DetailAction,
DividendAction: request.DividendAction,
StartTime: request.StartTime,
... ...
... ... @@ -144,6 +144,7 @@ type OrderQueryOption struct {
}
type DividendOrdersQueryOption struct {
PartnerId int64 `json:"partnerId"`
DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细)
DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出)
StartTime int64 `json:"startTime" `
... ...
... ... @@ -44,6 +44,9 @@ func (dao *OrderDao) DividendOrders(option *domain.DividendOrdersQueryOption) (c
q := tx.Model(&orders)
q.Column(`order.id`, `order.order_code`, `order.order_actual_amount`, `order.partner_bonus_percent`)
q.Where(`"order".order_status >=?`, domain.OrderStatusDeliverSome) //已经发货
if option.PartnerId > 0 {
q.Where(`"order".partner_id=?`, option.PartnerId)
}
if option.StartTime > 0 {
q.Where(`"order".create_at >=?`, time.Unix(option.StartTime/1000, 0))
}
... ...
... ... @@ -24,14 +24,15 @@ type DividendStatistics struct {
type Bonus struct {
Received float64 `json:"received"` //已收分红
Outstanding float64 `json:"outstanding"` //未收分红/分红支出
Outstanding float64 `json:"outstanding"` //未收分红
Expend float64 `json:"expend"` //季度分红支出
}
/*DividendOrders 分红订单*/
type DividendOrdersRequest struct {
DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细)
DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出)
StartTime int64 `json:"startTime" valid:"Required"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime" valid:"Required"`
PageIndex int `json:"pageIndex,omitempty"`
... ...