Sfoglia il codice sorgente

新增小程序审核直播一键开关

吴志根 3 anni fa
parent
commit
2cf3ee323b

+ 26 - 5
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -141,7 +141,7 @@ public class live extends Controller {
         SQLFactory sqlFactory = new SQLFactory(this, "门户直播列表", pageSize, pageNumber, "t1.livestatus,t1.createdate");
         sqlFactory.addParameter("siteid", siteid);
 //        sqlFactory.addParameter("livestatus", "%" + livestatus + "%");
-        sqlFactory.addParameter_SQL("where",where);
+        sqlFactory.addParameter_SQL("where", where);
         Rows agentRows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         for (Row row : agentRows) {
             //观看次数(次)
@@ -150,10 +150,15 @@ public class live extends Controller {
             long viewers = getCount("直播观看人数", "num", channelid);
             row.put("viewers", viewers);
         }
-//        //true:表示审核
-//        if (parameter.isminiapp()) {
-//            agentRows = new Rows();
-//        }
+        //true:表示审核
+        String sqlPara = "SELECT isminiapp from tparameter  ";
+        Rows rowsPara = dbConnect.runSqlQuery(sqlPara);
+        if (!rowsPara.isEmpty()) {
+            if (rowsPara.get(0).getBoolean("isminiapp")) {
+                agentRows = new Rows();
+            }
+
+        }
 //        return getSucReturnObject().setDataByPaging(new Rows()).preloading(1).toString();
         return getSucReturnObject().setDataByPaging(agentRows).preloading(1).toString();
     }
@@ -165,6 +170,22 @@ public class live extends Controller {
         return rows.isEmpty() ? 0 : rows.get(0).getLong(fieldname);
     }
 
+    /**
+     * 小程序审核专用:是否开启直播
+     *
+     * @return
+     */
+    public String isminiapp() {
+        int isminiapp = content.getIntValue("isminiapp");
+        String sqlPara = "UPDATE tparameter SET isminiapp = '" + isminiapp + "'";
+        String res = dbConnect.runSqlUpdate(sqlPara);
+        if (res.equals("true")) {
+            return getSucReturnObject().toString();
+        } else {
+            return getErrReturnObject().toString();
+        }
+    }
+
 
     /**
      * 热门展商