Browse Source

Merge branch 'develop'

沈静伟 3 years ago
parent
commit
b61a8818be

+ 3 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/live/live.java

@@ -276,14 +276,15 @@ public class live extends Controller {
         return getSucReturnObject().setData(new Polyv().getSignUrl(rows.get(0).getString("channelId"), rows.get(0).getString("secretkey"), userid)).toString();
     }
 
-
-    private String createPassWord() {
+    private static String createPassWord() {
         String allChar = "1234567890";
+        String allChar2 = "abcdefghijklmnopqrstuvwxyz";
         StringBuffer sb = new StringBuffer();
         Random random = new Random();
         for (int i = 0; i < 6; i++) {
             sb.append(allChar.charAt(random.nextInt(allChar.length())));
         }
+        sb.append(allChar2.charAt(random.nextInt(allChar2.length())));
         return sb.toString();
     }
 

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

@@ -6,6 +6,7 @@ select channelid,
        t.fintroduction,
        t.livestatus,
        count as fcustcount,
+       count as viewers,
        t.channelcoverimageurl,
        t4.saleprodclass,
        t4.faddress,

+ 18 - 13
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -6,6 +6,8 @@ import com.cnd3b.common.data.Row;
 import com.cnd3b.common.data.Rows;
 import com.cnd3b.common.data.RowsMap;
 import com.cnd3b.common.data.SQLFactory;
+import com.cnd3b.common.parameter.parameter;
+import com.cnd3b.utility.qywechat.base.Parameter;
 
 
 public class live extends Controller {
@@ -58,13 +60,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);
-        }
+//        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");
@@ -85,20 +87,23 @@ public class live extends Controller {
                 }
             }
             //限制在2022-03-17,2022-03-19
-            Long time1 = getTimestamp("2022-03-17 19:30:00");
             Long time2 = getTimestamp("2022-03-18 19:30:00");
             Long time3 = getTimestamp("2022-03-19 19:30:00");
             Long timeEnd = getTimestamp("2022-03-20 00:00:00");
             Long timeNow = System.currentTimeMillis();
-            System.err.println(time1);
-            long hour = 3600000*2;
-            System.err.println(time2+hour);
-            if ((timeNow >= time1 && timeNow <= time1 + hour) || (timeNow >= time2 && timeNow <= time2 + hour) || (timeNow >= time3 && timeNow <= time3 + hour) || (timeNow >= timeEnd)) {
+            long hour = 3600000 * 2;
+            System.err.println(time2 + hour);
+            if (parameter.isdebug()) {
                 resultObject.put("tlivelist", newliverows);
             } else {
-                resultObject.put("tlivelist", new Rows());
+                if ((timeNow >= time2 && timeNow <= time2 + hour) || (timeNow >= time3 && timeNow <= time3 + hour) || (timeNow >= timeEnd)) {
+                    resultObject.put("tlivelist", newliverows);
+                } else {
+                    resultObject.put("tlivelist", new Rows());
+                }
             }
 
+
             resultObject.put("pageSize", pageSize);
             resultObject.put("pageNumber", pageNumber);
             resultObject.put("total", flivecount);