短剧新需求
This commit is contained in:
parent
cf3fac6f88
commit
7b0c54ca22
|
|
@ -10,8 +10,8 @@
|
|||
t1.avatar,
|
||||
ifnull(t2.signInNum,0) as signInNum,
|
||||
ifnull(t2.awardAmount,0) as awardAmount
|
||||
from v_tb_user t1
|
||||
left JOIN (select x_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 x_user_id) t2 on t1.x_user_id = t2.x_user_id
|
||||
from tb_user t1
|
||||
left JOIN (select x_user_id,sum(money) as awardAmount,sum(case when title = '签到奖励' then 1 else 0 end) as signInNum from user_money_details where classify = 6 group by x_user_id) t2 on t1.x_user_id = t2.x_user_id
|
||||
<where>
|
||||
<if test="keywords != null and keywords != ''">
|
||||
and (t1.user_name like concat('%',#{keywords},'%') or t1.phone like concat('%',#{keywords},'%'))
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
t1.by_user_id AS userId,
|
||||
MIN( t1.create_time ) as createTime
|
||||
FROM
|
||||
v_user_money_details t1
|
||||
user_money_details t1
|
||||
WHERE 1=1
|
||||
AND t1.user_id = #{userId}
|
||||
AND t1.classify = 6
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
t2.phone as userPhone,
|
||||
t1.create_time as createTime
|
||||
FROM
|
||||
v_user_money_details t1
|
||||
user_money_details t1
|
||||
LEFT JOIN tb_user t2 on t1.by_user_id = t2.user_id
|
||||
WHERE
|
||||
t1.user_id = #{userId}
|
||||
|
|
@ -60,14 +60,14 @@
|
|||
ifnull( t3.residueDrawCount, 0 ) AS residueDrawCount,
|
||||
ifnull( t3.todayDrawCount, 0 ) AS todayDrawCount
|
||||
FROM
|
||||
v_tb_user t1
|
||||
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 <= DATE_FORMAT(CURDATE(), '%Y-%m-%d 23:59:59') then 1 else 0 end) as todayUnlocked
|
||||
FROM
|
||||
v_orders
|
||||
orders
|
||||
WHERE STATUS = 1 AND pay_way = 9
|
||||
GROUP BY user_id
|
||||
) t2 on t1.user_id = t2.user_id
|
||||
|
|
@ -77,8 +77,8 @@
|
|||
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
|
||||
FROM orders x
|
||||
LEFT JOIN disc_spinning_record y ON x.orders_id = y.source_id
|
||||
AND y.source = 'order'
|
||||
WHERE 1 = 1
|
||||
AND x.status = 1
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
t1.name,
|
||||
t1.number,
|
||||
t1.create_time
|
||||
from v_disc_spinning_record t1
|
||||
from disc_spinning_record t1
|
||||
where t1.user_id = #{userId}
|
||||
order by t1.id asc
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue