Przeglądaj źródła

门户直播列表查询支持模糊查询

吴志根 3 lat temu
rodzic
commit
b1f22455f2

+ 2 - 2
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/获取浏览电话分享前十.sql

@@ -1,7 +1,7 @@
-select top 10 isnull(t2.fname,'ÄäÃû') fname, t1.createdate, t1.tenterprise_userid,t2.fphonenumber
+select top 10 isnull(t2.fname,'ÄäÃû') fname, t1.createdate, t1.tenterprise_userid,t2.fphonenumber,t1.tsupplyanddemandid
 from tsupplyanddemand_log t1
          left JOIN tenterprise_users t2
                    ON t1.tenterprise_userid = t2.tenterprise_userid
-WHERE t1.tsupplyanddemandid = $tsupplyanddemandid$
+WHERE t1.tsupplyanddemandid in $tsupplyanddemandid$
   AND t1.ftype = $ftype$
 order by t1.createdate desc

+ 22 - 12
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -126,7 +126,7 @@ public class supplyanddemand extends Controller {
 //         * 阅读次数+1
 //         */
 //        dbConnect.runSqlUpdate("update tsupplyanddemand set freadtimes=isnull(freadtimes,0)+1 where siteid='" + siteid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
-        addsupplyanddemandLog(tsupplyanddemandid, 1,userid);
+        addsupplyanddemandLog(tsupplyanddemandid, 1, userid);
         SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
@@ -230,10 +230,18 @@ public class supplyanddemand extends Controller {
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         RowsMap attinfoRowsMap = getAttachmentUrl("tsupplyanddemand", rows.toArrayList("tsupplyanddemandid"));
 
+        RowsMap readRowsMap = getTop10Rows(rows.toArrayList("tsupplyanddemandid"),1).toRowsMap("tsupplyanddemandid");
+        RowsMap phoneRowsMap = getTop10Rows(rows.toArrayList("tsupplyanddemandid"),2).toRowsMap("tsupplyanddemandid");
+        RowsMap shareRowsMap = getTop10Rows(rows.toArrayList("tsupplyanddemandid"),3).toRowsMap("tsupplyanddemandid");
+
         for (Row row : rows) {
             row.put("attinfos", attinfoRowsMap.get(row.getString("tsupplyanddemandid")));
             //创建者头像
             row.put("headportraiturl", getHeadPic(row.getLong("tenterprise_userid")));
+            row.put("read", readRowsMap.get(row.getString("tsupplyanddemandid")));
+            row.put("phone", phoneRowsMap.get(row.getString("tsupplyanddemandid")));
+            row.put("share", shareRowsMap.get(row.getString("tsupplyanddemandid")));
+            row.put("indexTab", 0);
         }
         return getSucReturnObject().setDataByPaging(rows).saveToDataPool().toString();
     }
@@ -420,7 +428,7 @@ public class supplyanddemand extends Controller {
         long tenterprise_userid = content.getLong("tenterprise_userid");
 
 
-        addsupplyanddemandLog(tsupplyanddemandid, ftype,tenterprise_userid);
+        addsupplyanddemandLog(tsupplyanddemandid, ftype, tenterprise_userid);
 
         return getSucReturnObject().toString();
 
@@ -431,7 +439,7 @@ public class supplyanddemand extends Controller {
      *
      * @return
      */
-    public void addsupplyanddemandLog(Long tsupplyanddemandid, int ftype,long tenterprise_userid) throws P2Exception {
+    public void addsupplyanddemandLog(Long tsupplyanddemandid, int ftype, long tenterprise_userid) throws P2Exception {
         /**
          * 阅读次数+1
          */
@@ -484,9 +492,9 @@ public class supplyanddemand extends Controller {
     }
 
     public int getTimesSQl(Long tenterprise_userid, int ftype) {
-        SQLFactory sqlFactory = new SQLFactory(this,"查询分享电话浏览总数");
-        sqlFactory.addParameter("tenterprise_userid",tenterprise_userid);
-        sqlFactory.addParameter("ftype",ftype);
+        SQLFactory sqlFactory = new SQLFactory(this, "查询分享电话浏览总数");
+        sqlFactory.addParameter("tenterprise_userid", tenterprise_userid);
+        sqlFactory.addParameter("ftype", ftype);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         if (rows.isEmpty()) {
             return 0;
@@ -503,20 +511,23 @@ public class supplyanddemand extends Controller {
     public String getsupplyanddemandLogTop10() {
         Long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
 
+        ArrayList<String> list = new ArrayList<>();
+        list.add(String.valueOf(tsupplyanddemandid));
 
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("read", getTop10Rows(tsupplyanddemandid, 1));
-        jsonObject.put("phone", getTop10Rows(tsupplyanddemandid, 2));
-        jsonObject.put("share", getTop10Rows(tsupplyanddemandid, 3));
+        jsonObject.put("read", getTop10Rows(list, 1));
+        jsonObject.put("phone", getTop10Rows(list, 2));
+        jsonObject.put("share", getTop10Rows(list, 3));
+
 
         return getSucReturnObject().setData(jsonObject).toString();
 
 
     }
 
-    public Rows getTop10Rows(Long tsupplyanddemandid, int ftype) {
+    public Rows getTop10Rows(ArrayList<String> tsupplyanddemandid, int ftype) {
         SQLFactory sqlFactory = new SQLFactory(this, "获取浏览电话分享前十");
-        sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
+        sqlFactory.addParameter_in("tsupplyanddemandid", tsupplyanddemandid);
         sqlFactory.addParameter("ftype", ftype);
 
         Rows rows = dbConnect.runSqlQuery(sqlFactory);
@@ -536,7 +547,6 @@ public class supplyanddemand extends Controller {
     public String getsupplyanddemandLogList() {
         Long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
         int ftype = content.getIntValue("ftype");
-
         SQLFactory sqlFactory = new SQLFactory(this, "获取浏览电话分享", pageSize, pageNumber, "t1.createdate desc");
         sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
         sqlFactory.addParameter("ftype", ftype);

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/bannermag/bannermag.java

@@ -35,6 +35,8 @@ public class bannermag extends Controller {
                 bannerrow.put("attinfos", getAttachmentUrl("tbannermag", bannerrow.getString("tbannermagid")));
             }
             locationrow.put("banner", bannerRows);
+            locationrow.put("servicehotline", "13157370035");
+            locationrow.put("webclienturl", "https://www.buwanjia.com/customer/index.html");
         }
         return getSucReturnObject().setData(locationrows).toString();
     }

+ 1 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/门户直播列表.sql

@@ -27,6 +27,7 @@ from tlive t1
          inner join tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
 where t1.siteid = $siteid$
   and t1.livestatus like $livestatus$
+and $where$
 
 
 

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

@@ -123,11 +123,25 @@ public class live extends Controller {
      * @return
      */
     public String getHomeLive() {
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t2.fagentname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t2.fbrand like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
         //直播状态 unStart:未开始 live:直播中 end:已结束 waiting:等待中 playback:回放中
         String livestatus = content.getString("livestatus");
         SQLFactory sqlFactory = new SQLFactory(this, "门户直播列表", pageSize, pageNumber, "t1.createdate");
         sqlFactory.addParameter("siteid", siteid);
         sqlFactory.addParameter("livestatus", "%" + livestatus + "%");
+        sqlFactory.addParameter_SQL("where",where);
         Rows agentRows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         for (Row row : agentRows) {
             //观看次数(次)