Преглед изворни кода

直播信息展示
1:当前线上观众人数查询
2:线上观众人数查询
3:观看直播地区人数占比

沈静伟 пре 4 година
родитељ
комит
a4391b598c

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

@@ -1,9 +1,9 @@
-select channelid,tagentsid,t.fbrand,t.saleprodclass,count as fcount,t.channelcoverimageurl,fliveshowurl from (
+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,
 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,
 t1.count,t2.channelcoverimageurl,t2.fliveshowurl,
-t3.fbrand,t3.saleprodclass
+t3.fbrand,t3.flocationclass,t3.flocation,t3.fintroduction
 from tlive_usercount t1
 from tlive_usercount t1
 inner join tlive t2 on t1.channelid=t2.channelid --and t2.livestatus='live'
 inner join tlive t2 on t1.channelid=t2.channelid --and t2.livestatus='live'
-inner join tagents t3 on t2.siteid=t3.siteid and t2.tagentsid=t3.tagentsid
+inner join tactivity_agentmsg t3 on t2.siteid=t3.siteid and t2.tagentsid=t3.tagentsid
 where t2.tactivityid=$tactivityid$
 where t2.tactivityid=$tactivityid$
 )t where t.num=1
 )t where t.num=1

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/线上观众人数趋势.sql

@@ -0,0 +1,3 @@
+select right(convert(varchar(16),time,120),5)as time,max(count) as fcount from tlive_usercount
+--where convert(varchar(10),time,120)=convert(varchar(10),getdate(),120)
+group by convert(varchar(16),time,120) order by time

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/观看直播地区人数占比.sql

@@ -0,0 +1,3 @@
+select province,city,count(0)fcount from tlive_viewlog
+--where currentday=convert(varchar(10),getdate(),120)
+group by province,city

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

@@ -80,4 +80,24 @@ public class live extends Controller {
         return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
         return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
     }
     }
 
 
+    /**
+     * 线上观众人数趋势(今日)
+     *
+     * @return
+     */
+    public String getLiveData() {
+        String tactivityid = content.getString("tactivityid");
+        SQLFactory sql1 = new SQLFactory(this, "线上观众人数趋势");
+        sql1.addParameter("tactivityid", tactivityid);
+        Rows rows1 = sql1.runSqlQuery();
+
+        SQLFactory sql2 = new SQLFactory(this, "观看直播地区人数占比");
+        sql2.addParameter("tactivityid", tactivityid);
+        Rows rows2 = sql2.runSqlQuery();
+
+        JSONObject object = new JSONObject();
+        object.put("custcount", rows1);
+        object.put("citycount", rows2);
+        return getSucReturnObject().setData(object).saveToDataPool(5).toString();
+    }
 }
 }