Browse Source

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

沈静伟 3 years ago
parent
commit
2775ae984d

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/搜索_直播.sql

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

+ 3 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/搜索_通告.sql

@@ -19,7 +19,9 @@ SELECT t1.tnoticeid,
        t1.fishomepage,
        t1.fissingleagent,
        t1.fisspecifiedrange,
-       t1.tenterprise_userid
+       t1.tenterprise_userid,
+       t2.fagentname
 from TNOTICE as t1
+         inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
 WHERE t1.siteid = $siteid$
   and (t1.fcontent LIKE $keyStr$ OR t1.createby LIKE $keyStr$ OR t1.ftitle LIKE $keyStr$ OR t1.fsummary LIKE $keyStr$ )

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/直播观看人数.sql

@@ -0,0 +1,2 @@
+--Ö±²¥¼ä¹Û¿´×ÜÈËÊý
+select count(distinct param1)as num from tlive_viewlog where channelid=$channelid$

+ 17 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/homepage.java

@@ -314,6 +314,15 @@ public class homepage extends Controller {
             sqlFactory_tlive.addParameter("siteid", siteid);
             sqlFactory_tlive.addParameter("keyStr", "%" + keyStr + "%");
             Rows row_tlive = dbConnect.runSqlQuery(sqlFactory_tlive.getSQL());
+
+            for(Row row:row_tlive){
+                //观看次数(次)
+                String channelid = row.getString("channelid");
+                //观看人数(人)
+                long viewers = getCount("直播观看人数", "num", channelid);
+                row.put("viewers", viewers);
+            }
+
             resultObject.put("tlive", row_tlive);
         } else {
             resultObject.put("tlive", new Rows());
@@ -359,4 +368,12 @@ public class homepage extends Controller {
         return getSucReturnObject().setData(resultObject).toString();
     }
 
+
+    public long getCount(String SQLMODELNAME, String fieldname, String channelid) {
+        SQLFactory sqlFactory = new SQLFactory(this, SQLMODELNAME);
+        sqlFactory.addParameter("channelid", channelid);
+        Rows rows = sqlFactory.runSqlQuery();
+        return rows.isEmpty() ? 0 : rows.get(0).getLong(fieldname);
+    }
+
 }