Просмотр исходного кода

新增商户观众总数排行

沈静伟 4 лет назад
Родитель
Сommit
dea8647084

+ 5 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/商户观众总数排行.sql

@@ -0,0 +1,5 @@
+select t3.fbrand,count(0)fcount from tlive_viewlog t1
+inner join tlive t2 on t1.channelid=t2.channelid
+inner join tactivity_agentmsg t3 on t2.siteid=t3.siteid and t2.tactivityid=t3.tactivityid and t2.tagentsid=t3.tagentsid
+--where currentday=convert(varchar(10),getdate(),120)
+group by t3.fbrand order by count(0) desc

+ 8 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -39,12 +39,20 @@ public class live extends Controller {
         livecustcount.addParameter("tactivityid", tactivityid);
         livecustcount.addParameter("siteid", siteid);
         Rows liverows = dbConnect.runSqlQuery(livecustcount.getSQL());
+
+        SQLFactory brandcustcount = new SQLFactory(this, "商户观众总数排行");
+        brandcustcount.addParameter("tactivityid", tactivityid);
+        brandcustcount.addParameter("siteid", siteid);
+        Rows brandcustcountrows = dbConnect.runSqlQuery(brandcustcount.getSQL());
+
         //正在直播数
         resultObject.put("flivecount", liverows.size());
         //当前在线观众人数
         resultObject.put("fcustcount", liverows.isEmpty() ? 0 : liverows.sum("fcount"));
         //直播列表
         resultObject.put("tlivelist", liverows);
+        //商户观众总数排行
+        resultObject.put("brandcustcount", brandcustcountrows);
         return getSucReturnObject().setData(resultObject).toString();
     }