|
@@ -362,6 +362,7 @@ public class live extends Controller {
|
|
|
String channelid = content.getString("channelid");
|
|
|
//String sql = "SELECT [count] FROM tlive_usercount WHERE [time]='" + getDateTime_Str() + "' AND channelid='" + channelid + "'";
|
|
|
String sql = "select channelid,count as fcustcount from (select ROW_NUMBER()over(partition by t1.channelid order by t1.time desc)as num,t1.channelid,t1.count from tlive_usercount t1 where t1. channelid='" + channelid + "')t where t.num=1";
|
|
|
+ System.err.println(sql);
|
|
|
Rows rows = dbConnect.runSqlQuery(sql);
|
|
|
JSONObject resultObject = new JSONObject();
|
|
|
resultObject.put("count", rows.isEmpty() ? 0 : rows.get(0).getLong("fcustcount"));
|