|
|
@@ -1,9 +1,28 @@
|
|
|
-select channelid,tagentsid,t.fbrand,t.flocationclass,t.flocation,t.fintroduction,count as fcustcount,t.channelcoverimageurl,fliveshowurl from (
|
|
|
-select ROW_NUMBER()over(partition by t1.channelid order by t1.time desc)as num,t1.channelid,t2.tagentsid,
|
|
|
-t1.count,t2.channelcoverimageurl,t2.fliveshowurl,
|
|
|
-t3.fbrand,t3.flocationclass,t3.flocation,t3.fintroduction
|
|
|
-from tlive_usercount t1
|
|
|
-inner join tlive t2 on t1.channelid=t2.channelid and t2.livestatus='live'
|
|
|
-inner join tactivity_agentmsg t3 on t2.siteid=t3.siteid and t2.tagentsid=t3.tagentsid
|
|
|
-where t2.tactivityid=$tactivityid$ and t2.siteid=$siteid$
|
|
|
-)t where t.num=1
|
|
|
+select channelid,
|
|
|
+ tagentsid,
|
|
|
+ t.fbrand,
|
|
|
+ t.flocationclass,
|
|
|
+ t.flocation,
|
|
|
+ t.fintroduction,
|
|
|
+ t.livestatus,
|
|
|
+ count as fcustcount,
|
|
|
+ t.channelcoverimageurl,
|
|
|
+ fliveshowurl
|
|
|
+from (
|
|
|
+ select ROW_NUMBER() over(partition by t1.channelid order by t1.time desc)as num,t1.channelid,
|
|
|
+ t2.tagentsid,
|
|
|
+ t2.livestatus,
|
|
|
+ t1.count,
|
|
|
+ t2.channelcoverimageurl,
|
|
|
+ t2.fliveshowurl,
|
|
|
+ t3.fbrand,
|
|
|
+ t3.flocationclass,
|
|
|
+ t3.flocation,
|
|
|
+ t3.fintroduction
|
|
|
+ from tlive_usercount t1
|
|
|
+ inner join tlive t2 on t1.channelid = t2.channelid and t2.livestatus = 'live'
|
|
|
+ inner join tactivity_agentmsg t3 on t2.siteid = t3.siteid and t2.tagentsid = t3.tagentsid
|
|
|
+ where t2.tactivityid = $tactivityid$
|
|
|
+ and t2.siteid = $siteid$
|
|
|
+ ) t
|
|
|
+where t.num = 1
|