|
|
@@ -17,15 +17,23 @@ public class live extends Controller {
|
|
|
*/
|
|
|
public String getLiveChannelData() {
|
|
|
Rows liveCountRows = dbConnect.runSqlQuery("select count(0)fcount from tlive where livestatus='live'");
|
|
|
- Rows custCountrows = dbConnect.runSqlQuery(new SQLFactory(this, "当前线上观众人数查询").getSQL());
|
|
|
- Rows totalcustCountrows = dbConnect.runSqlQuery("select count(0)fcount from TLIVE_VIEWLOG");
|
|
|
+ Rows liverows = dbConnect.runSqlQuery(new SQLFactory(this, "当前线上观众人数查询").getSQL());
|
|
|
+ Rows totalcustCountrows = dbConnect.runSqlQuery("select count(0)fcount from tlive_viewlog");
|
|
|
|
|
|
JSONObject resultObject = new JSONObject();
|
|
|
+ //直播商户数
|
|
|
resultObject.put("flivecount", liveCountRows.isEmpty() ? 0 : liveCountRows.get(0).getInteger("fcount"));
|
|
|
- resultObject.put("fcustcount", custCountrows.isEmpty() ? 0 : custCountrows.get(0).getInteger("fcount"));
|
|
|
+ //当前在线观众人数
|
|
|
+ resultObject.put("fcustcount", liverows.isEmpty() ? 0 : liverows.sum("fcount"));
|
|
|
+ //直播总时长
|
|
|
resultObject.put("ftotallivetime", 1000);
|
|
|
+ //观众总人数
|
|
|
resultObject.put("ftotalcustcount", totalcustCountrows.isEmpty() ? 0 : totalcustCountrows.get(0).getInteger("fcount"));
|
|
|
+ /**
|
|
|
+ * 直播列表
|
|
|
+ */
|
|
|
+ resultObject.put("tlivelist", liverows);
|
|
|
return getSucReturnObject().setData(resultObject).toString();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|