瀏覽代碼

获取实时观众列表:获取5分钟内修改的

吴志根 3 年之前
父節點
當前提交
e82b948f61

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

@@ -16,5 +16,5 @@ SELECT t1.PARAM2                                                AS name,
        )                                                        AS viewcount,
        t1.param3                                                AS viewtype
 FROM tlive_viewlog AS t1
-WHERE t1.createdtime = $createdtime$
+WHERE t1.lastmodified > lastmodified
   AND t1.channelid = $channelid$

+ 3 - 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();
     }