...
|
...
|
@@ -43,7 +43,7 @@ func (dao *OrderDao) DividendOrders(option *domain.DividendOrdersQueryOption) (c |
|
|
tx := dao.transactionContext.PgTx
|
|
|
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) //已经发货
|
|
|
//q.Where(`"order".order_status >=?`, domain.OrderStatusDeliverSome) //已经发货
|
|
|
if option.PartnerId > 0 {
|
|
|
q.Where(`"order".partner_id=?`, option.PartnerId)
|
|
|
}
|
...
|
...
|
@@ -57,7 +57,7 @@ func (dao *OrderDao) DividendOrders(option *domain.DividendOrdersQueryOption) (c |
|
|
if option.DetailAction == 0 { //已收明细
|
|
|
q.Join(`JOIN order_payment as a ON a.order_id="order".id`)
|
|
|
q.Where(`"a".bonus_status=?`, domain.BonusPaid)
|
|
|
} else if option.DetailAction == 1 { //未收明细
|
|
|
} else if option.DetailAction == 1 { //未收明细 //实际金额>已支付金额
|
|
|
q.Where(`"order".order_actual_amount>"order".order_payment_amount`)
|
|
|
}
|
|
|
} else if option.DividendAction == 1 { //分红支出
|
...
|
...
|
|