|
|
@@ -113,7 +113,7 @@ public class live extends Controller {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 直播数据统计(频道)
|
|
|
+ * 展会直播数据统计(频道)
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@@ -145,27 +145,27 @@ public class live extends Controller {
|
|
|
*/
|
|
|
public String getLiveDataCountForSession() throws P2Exception {
|
|
|
String sessionid = content.getString("sessionid");
|
|
|
- double livepv = 0;
|
|
|
- double liveuv = 0;
|
|
|
- double duration = 0;
|
|
|
+ int livepv = 0;
|
|
|
+ int liveuv = 0;
|
|
|
+ int duration = 0;
|
|
|
PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tlive_sessiondata", "sessionid = '" + sessionid + "'");
|
|
|
if (!paoSetRemote.isEmpty()) {
|
|
|
PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
//人数
|
|
|
- livepv = paoRemote.getDouble("livepv");
|
|
|
+ livepv = paoRemote.getInt("livepv");
|
|
|
//人次
|
|
|
- liveuv = paoRemote.getDouble("liveuv");
|
|
|
+ liveuv = paoRemote.getInt("liveuv");
|
|
|
//时长
|
|
|
- duration = paoRemote.getDouble("duration");
|
|
|
+ duration = paoRemote.getInt("duration")/60;
|
|
|
}
|
|
|
|
|
|
JSONObject resultObject = new JSONObject();
|
|
|
|
|
|
- resultObject.put("viewers", String.format("%.2f", livepv));
|
|
|
- resultObject.put("viewCounts", String.format("%.2f", liveuv));
|
|
|
- resultObject.put("viewDuration", String.format("%.2f", duration));
|
|
|
- resultObject.put("viewCountsAvg", String.format("%.2f", livepv == 0 ? 0 : liveuv / livepv));
|
|
|
- resultObject.put("viewDurationAvg", String.format("%.2f", livepv == 0 ? 0 : duration / livepv));
|
|
|
+ resultObject.put("viewers", livepv);
|
|
|
+ resultObject.put("viewCounts", liveuv);
|
|
|
+ resultObject.put("viewDuration", duration);
|
|
|
+ resultObject.put("viewCountsAvg", livepv == 0 ? 0 : liveuv / livepv);
|
|
|
+ resultObject.put("viewDurationAvg", livepv == 0 ? 0 : duration / livepv);
|
|
|
|
|
|
return getSucReturnObject().setData(resultObject).toString();
|
|
|
}
|
|
|
@@ -260,27 +260,27 @@ public class live extends Controller {
|
|
|
*/
|
|
|
public String getSYLiveDataCountForSession() throws P2Exception {
|
|
|
String sessionid = content.getString("sessionid");
|
|
|
- double livepv = 0;
|
|
|
- double liveuv = 0;
|
|
|
- double duration = 0;
|
|
|
+ int livepv = 0;
|
|
|
+ int liveuv = 0;
|
|
|
+ int duration = 0;
|
|
|
PaoSetRemote paoSetRemote = getP2ServerSystemPaoSet("tlive_sessiondata", "sessionid = '" + sessionid + "'");
|
|
|
if (!paoSetRemote.isEmpty()) {
|
|
|
PaoRemote paoRemote = paoSetRemote.getPao(0);
|
|
|
//人数
|
|
|
- livepv = paoRemote.getDouble("livepv");
|
|
|
+ livepv = paoRemote.getInt("livepv");
|
|
|
//人次
|
|
|
- liveuv = paoRemote.getDouble("liveuv");
|
|
|
+ liveuv = paoRemote.getInt("liveuv");
|
|
|
//时长
|
|
|
- duration = paoRemote.getDouble("duration");
|
|
|
+ duration = paoRemote.getInt("duration")/60;
|
|
|
}
|
|
|
|
|
|
JSONObject resultObject = new JSONObject();
|
|
|
|
|
|
- resultObject.put("viewers", String.format("%.2f", livepv));
|
|
|
- resultObject.put("viewCounts", String.format("%.2f", liveuv));
|
|
|
- resultObject.put("viewDuration", String.format("%.2f", duration));
|
|
|
- resultObject.put("viewCountsAvg", String.format("%.2f", livepv == 0 ? 0 : liveuv / livepv));
|
|
|
- resultObject.put("viewDurationAvg", String.format("%.2f", livepv == 0 ? 0 : duration / livepv));
|
|
|
+ resultObject.put("viewers", livepv);
|
|
|
+ resultObject.put("viewCounts", liveuv);
|
|
|
+ resultObject.put("viewDuration", duration);
|
|
|
+ resultObject.put("viewCountsAvg", livepv == 0 ? 0 : liveuv / livepv);
|
|
|
+ resultObject.put("viewDurationAvg", livepv == 0 ? 0 : duration / livepv);
|
|
|
|
|
|
return getSucReturnObject().setData(resultObject).toString();
|
|
|
}
|