短剧新需求

This commit is contained in:
Tankaikai 2025-04-02 14:54:23 +08:00
parent 4b1d18e0f2
commit c2276c3bbb
1 changed files with 5 additions and 32 deletions

View File

@ -14,7 +14,7 @@
left JOIN (select user_id,sum(money) as awardAmount,sum(case when title = '签到奖励' then 1 else 0 end) as signInNum from v_user_money_details where classify = 6 group by user_id) t2 on t1.user_id = t2.user_id
<where>
<if test="keywords != null and keywords != ''">
and (t1.user_name like concat('%',${keywords},'%') or t1.phone like concat('%',${keywords},'%'))
and (t1.user_name = ${keywords} or t1.phone = ${keywords})
</if>
</where>
ORDER BY t2.signInNum desc,t1.user_id asc
@ -71,43 +71,16 @@
t1.avatar,
t1.user_name as userName,
t1.phone,
ifnull( t2.unlocked, 0 ) AS unlocked,
ifnull( t2.todayUnlocked, 0 ) AS todayUnlocked,
ifnull( t3.totalDrawCount, 0 ) AS totalDrawCount,
ifnull( t3.residueDrawCount, 0 ) AS residueDrawCount,
ifnull( t3.todayDrawCount, 0 ) AS todayDrawCount
(select count(1) from v_orders where STATUS = 1 and pay_way = 9 and user_id = t1.user_id and pay_time >= DATE_FORMAT(CURDATE(), '%Y-%m-%d 00:00:00') and pay_time <= DATE_FORMAT(CURDATE(), '%Y-%m-%d 23:59:59') ) as todayUnlocked,
(select count(1) from v_disc_spinning_record where user_id = t1.user_id and DATE_FORMAT(create_time,'%Y-%m-%d') = CURDATE()) as todayDrawCount
FROM
v_tb_user t1
LEFT JOIN (
SELECT
user_id,
count( 1 ) AS unlocked,
sum(CASE WHEN pay_time >= DATE_FORMAT(CURDATE(), '%Y-%m-%d 00:00:00') and pay_time &lt;= DATE_FORMAT(CURDATE(), '%Y-%m-%d 23:59:59') then 1 else 0 end) as todayUnlocked
FROM
v_orders
WHERE STATUS = 1 AND pay_way = 9
GROUP BY user_id
) t2 on t1.user_id = t2.user_id
LEFT JOIN (
SELECT
x.user_id,
count(x.orders_id) as totalDrawCount,
sum(case when y.source_id is null then 1 else 0 end) as residueDrawCount,
sum(case when y.source_id is not null and DATE_FORMAT(y.create_time,'%Y-%m-%d') = CURDATE() then 1 else 0 end) as todayDrawCount
FROM v_orders x
LEFT JOIN v_disc_spinning_record y ON x.orders_id = y.source_id
AND y.source = 'order'
WHERE 1 = 1
AND x.status = 1
AND x.pay_way = 9
group by x.user_id
) t3 on t1.user_id = t3.user_id
<where>
<if test="keywords != null and keywords != ''">
and (t1.user_name like concat('%',${keywords},'%') or t1.phone like concat('%',${keywords},'%'))
and (t1.user_name = ${keywords} or t1.phone = ${keywords})
</if>
</where>
order by t2.unlocked desc,t1.user_id asc
order by todayUnlocked desc,t1.user_id asc
</select>
<select id="findLotteryDetailPage" resultType="com.sqx.modules.ext.dto.LotteryDetailDTO">
select