| | |
| | | inner join contract_order c on a.id=c.member_id |
| | | <where> |
| | | <if test="record!=null"> |
| | | <if test="record.refererIds!=null and record.refererIds!=''"> |
| | | find_in_set(#{record.refererIds}, a.referer_ids) |
| | | </if> |
| | | <if test="record.refererId!=null and record.refererId!=''"> |
| | | find_in_set(#{record.refererId}, a.referer_ids) |
| | | and a.referer_id=#{record.refererId} |
| | | </if> |
| | | <if test="record.name!=null and record.name!=''"> |
| | | and (a.phone=#{record.name} or a.email=#{record.name} or a.invite_id=#{record.name}) |
| | | </if> |
| | | <if test='record.timeType=="1"'> |
| | | and TO_DAYS(c.create_time) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test='record.timeType=="2"'> |
| | | and TO_DAYS(NOW()) - TO_DAYS(c.create_time) = 1 |
| | | </if> |
| | | <if test='record.timeType=="3"'> |
| | | and YEARWEEK(date_format(c.create_time,'%Y-%m-%d')) = YEARWEEK(now()) |
| | | </if> |
| | | <if test='record.timeType=="4"'> |
| | | and DATE_FORMAT(c.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' ) |
| | | </if> |
| | | and order_status = 1 |
| | | </if> |