|
@@ -19,9 +19,11 @@ public class live extends Controller {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public String getLiveChannelData() {
|
|
public String getLiveChannelData() {
|
|
|
|
+
|
|
|
|
+
|
|
String tactivityid = content.getString("tactivityid");
|
|
String tactivityid = content.getString("tactivityid");
|
|
String saleprodclass = content.getString("saleprodclass");
|
|
String saleprodclass = content.getString("saleprodclass");
|
|
- if(saleprodclass==null){
|
|
|
|
|
|
+ if (saleprodclass == null) {
|
|
saleprodclass = "";
|
|
saleprodclass = "";
|
|
}
|
|
}
|
|
JSONObject resultObject = new JSONObject();
|
|
JSONObject resultObject = new JSONObject();
|
|
@@ -42,7 +44,7 @@ public class live extends Controller {
|
|
SQLFactory livecustcount = new SQLFactory(this, "当前线上观众人数查询");
|
|
SQLFactory livecustcount = new SQLFactory(this, "当前线上观众人数查询");
|
|
livecustcount.addParameter("tactivityid", tactivityid);
|
|
livecustcount.addParameter("tactivityid", tactivityid);
|
|
livecustcount.addParameter("siteid", siteid);
|
|
livecustcount.addParameter("siteid", siteid);
|
|
- livecustcount.addParameter("saleprodclass","%"+saleprodclass+"%");
|
|
|
|
|
|
+ livecustcount.addParameter("saleprodclass", "%" + saleprodclass + "%");
|
|
Rows liverows = dbConnect.runSqlQuery(livecustcount.getSQL());
|
|
Rows liverows = dbConnect.runSqlQuery(livecustcount.getSQL());
|
|
|
|
|
|
String sql = livecustcount.getSQL();
|
|
String sql = livecustcount.getSQL();
|
|
@@ -56,7 +58,7 @@ public class live extends Controller {
|
|
resultObject.put("flivecount", flivecount);
|
|
resultObject.put("flivecount", flivecount);
|
|
//当前在线观众人数
|
|
//当前在线观众人数
|
|
resultObject.put("fcustcount", liverows.isEmpty() ? 0 : liverows.sum("fcustcount"));
|
|
resultObject.put("fcustcount", liverows.isEmpty() ? 0 : liverows.sum("fcustcount"));
|
|
- for(Row row:liverows){
|
|
|
|
|
|
+ for (Row row : liverows) {
|
|
//观看次数(次)
|
|
//观看次数(次)
|
|
String channelid = row.getString("channelid");
|
|
String channelid = row.getString("channelid");
|
|
//观看人数(人)
|
|
//观看人数(人)
|
|
@@ -82,7 +84,21 @@ public class live extends Controller {
|
|
newliverows.add(liverows.get(i));
|
|
newliverows.add(liverows.get(i));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- resultObject.put("tlivelist", newliverows);
|
|
|
|
|
|
+ //限制在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)) {
|
|
|
|
+ resultObject.put("tlivelist", newliverows);
|
|
|
|
+ } else {
|
|
|
|
+ resultObject.put("tlivelist", new Rows());
|
|
|
|
+ }
|
|
|
|
+
|
|
resultObject.put("pageSize", pageSize);
|
|
resultObject.put("pageSize", pageSize);
|
|
resultObject.put("pageNumber", pageNumber);
|
|
resultObject.put("pageNumber", pageNumber);
|
|
resultObject.put("total", flivecount);
|
|
resultObject.put("total", flivecount);
|