Browse Source

获取当前直播商户支持saleprodclass模糊查询

吴志根 3 years ago
parent
commit
e03b49b7e8

+ 9 - 5
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/当前线上观众人数查询.sql

@@ -1,5 +1,5 @@
 select channelid,
-       tagentsid,
+       t.tagentsid,
        t.fbrand,
        t.flocationclass,
        t.flocation,
@@ -7,12 +7,13 @@ select channelid,
        t.livestatus,
        count as fcustcount,
        t.channelcoverimageurl,
+       t4.saleprodclass,
        fliveshowurl
 from (
          select ROW_NUMBER() over(partition by t1.channelid order by t1.time desc)as num,t1.channelid,
                 t2.tagentsid,
                 t2.livestatus,
-                (t1.count+t1.fadjustcount)as count,
+                (t1.count + t1.fadjustcount)as count,
                 t2.channelcoverimageurl,
                 t2.fliveshowurl,
                 t3.fbrand,
@@ -20,9 +21,12 @@ from (
                 t3.flocation,
                 t3.fintroduction
          from tlive_usercount t1
-                  inner join tlive t2 on t1.channelid = t2.channelid and t2.livestatus = 'live'
-                  inner join tactivity_agentmsg t3 on t2.siteid = t3.siteid and t2.tagentsid = t3.tagentsid
+             inner join tlive t2
+         on t1.channelid = t2.channelid and t2.livestatus = 'live'
+             inner join tactivity_agentmsg t3 on t2.siteid = t3.siteid and t2.tagentsid = t3.tagentsid
          where t2.tactivityid = $tactivityid$
            and t2.siteid = $siteid$
      ) t
-where t.num = 1
+         left join tagents t4 on t4.tagentsid = t.tagentsid
+where t.num = 1
+  and t4.saleprodclass LIKE $saleprodclass$

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

@@ -20,6 +20,10 @@ public class live extends Controller {
      */
     public String getLiveChannelData() {
         String tactivityid = content.getString("tactivityid");
+        String saleprodclass = content.getString("saleprodclass");
+        if(saleprodclass==null){
+            saleprodclass = "";
+        }
         JSONObject resultObject = new JSONObject();
         //参展商
         SQLFactory agentcountSql = new SQLFactory(this, "活动直播间总数查询");
@@ -38,8 +42,11 @@ public class live extends Controller {
         SQLFactory livecustcount = new SQLFactory(this, "当前线上观众人数查询");
         livecustcount.addParameter("tactivityid", tactivityid);
         livecustcount.addParameter("siteid", siteid);
+        livecustcount.addParameter("saleprodclass","%"+saleprodclass+"%");
         Rows liverows = dbConnect.runSqlQuery(livecustcount.getSQL());
 
+        String sql = livecustcount.getSQL();
+
         SQLFactory brandcustcount = new SQLFactory(this, "商户观众总数排行");
         brandcustcount.addParameter("tactivityid", tactivityid);
         brandcustcount.addParameter("siteid", siteid);