Przeglądaj źródła

当前直播商户数

吴志根 3 lat temu
rodzic
commit
d1cb8ebab7

+ 28 - 9
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/当前线上观众人数查询.sql

@@ -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

+ 7 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -50,6 +50,13 @@ public class live extends Controller {
         resultObject.put("flivecount", flivecount);
         //当前在线观众人数
         resultObject.put("fcustcount", liverows.isEmpty() ? 0 : liverows.sum("fcustcount"));
+        for(Row row:liverows){
+            //观看次数(次)
+            String channelid = row.getString("channelid");
+            //观看人数(人)
+            long viewers = getCount("直播观看人数", "num", channelid);
+            row.put("viewers", viewers);
+        }
         //直播列表
         int pageSize = content.getIntValue("pageSize");
         int pageNumber = content.getIntValue("pageNumber");