ソースを参照

Merge remote-tracking branch 'origin/develop' into develop

沈静伟 3 年 前
コミット
d9d01d3631

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/customer/live/SQL/合作商直播列表.sql

@@ -19,7 +19,8 @@ select t1.tliveid,
        t1.fisneedauth,
        t1.secretkey,
        t1.livestatus,
-       t1.channelcoverimageurl
+       t1.channelcoverimageurl,
+       t2.fagentname
 from tlive t1
          inner join tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
 where t1.siteid = $siteid$

+ 18 - 6
src/dsb/com/cnd3b/restcontroller/customer/live/SQL/实时观众列表.sql

@@ -1,8 +1,20 @@
-SELECT t1.tlive_viewlogid,
-       t1.channelid,
-       CONVERT(varchar (100), DATEADD(S, convert(float, t1.createdtime) / 1000, '1970-01-01 08:00'), 120) as createdtime,
-       t1.param1 AS viewerid,
-       t1.param2 AS viewername
+SELECT t1.PARAM2                                                AS name,
+       t1.PARAM1                                                AS userid,
+       t1.playduration,
+       CONVERT(varchar (100), DATEADD(S, convert(float, t1.createdtime) / 1000, '1970-01-01 08:00'), 120) as datetime,
+       t1.province,
+       t1.city,
+       t1.ipaddress,
+       t1.useragent,
+       t1.ismobile,
+       t1.browser,
+       (
+           SELECT liveuv
+                      AS num
+           FROM tlive_sessiondata AS t2
+           WHERE t1.sessionid = t2.sessionid
+       )                                                        AS viewcount,
+       t1.param3                                                AS viewtype
 FROM tlive_viewlog AS t1
-WHERE t1.createdtime = $createdtime$
+WHERE t1.lastmodified > $lastmodified$
   AND t1.channelid = $channelid$

+ 14 - 2
src/dsb/com/cnd3b/restcontroller/customer/live/live.java

@@ -375,10 +375,11 @@ public class live extends Controller {
      */
     public String getRealTimeViewerList() {
         String channelid = content.getString("channelid");
-        Long createdtime = getDateTime().getTime() / 1000;
+        Long lastmodified = getDateTime().getTime() / 1000- 5* 60;
+        System.err.println(lastmodified);
         SQLFactory sqlFactory = new SQLFactory(this, "实时观众列表", pageSize, pageNumber, "t1.tlive_viewlogid DESC");
         sqlFactory.addParameter("channelid", channelid);
-        sqlFactory.addParameter("createdtime", createdtime * 1000);
+        sqlFactory.addParameter("lastmodified", lastmodified * 1000);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         return getSucReturnObject().setDataByPaging(rows).preloading(1).toString();
     }
@@ -417,6 +418,17 @@ public class live extends Controller {
         sqlFactory.addParameter_in("tagentsidList", tagentsidList);
         Rows agentRows = dbConnect.runSqlQuery(sqlFactory.getSQL());
 
+        for(Row row:agentRows){
+            //观看次数(次)
+            String channelid = row.getString("channelid");
+            //观看人数(人)
+            long viewers = getCount("观看人数", "num", channelid);
+            row.put("viewers", viewers);
+        }
+
+
+
+
         return getSucReturnObject().setData(agentRows).toString();
     }