作者 陈志颖

fix:高管分红统计增加时间限制

... ... @@ -115,7 +115,7 @@ A left join
plan_order_amount amount,
(case when use_order_count>=0 then use_partner_bonus else plan_partner_bonus end) bonus,
partner_bonus_expense bonus_expense FROM "order_base" AS "order_base"
WHERE (partner_id in (?)) and (order_type in (?))
WHERE (partner_id in (?)) and (order_type in (?) and (sale_date < ?) )
UNION ALL
SELECT partner_info_id partner_id,
0 amount, bonus bonus, bonus_expense bonus_expense FROM business_bonus
... ... @@ -132,7 +132,7 @@ GROUP BY partner_id
sql.WriteString(fmt.Sprintf(" \nOFFSET %v", offset))
}
}
_, err = tx.Query(&statics, sql.String(), pg.In(partnerIds), pg.In(partnerIds), pg.In(domain.UserOrderTypes(domain.Career)), pg.In(partnerIds))
_, err = tx.Query(&statics, sql.String(), pg.In(partnerIds), pg.In(partnerIds), pg.In(domain.UserOrderTypes(domain.Career)), GetDayEnd(), pg.In(partnerIds))
return
}
... ...