瀏覽代碼

新增一个公共关注榜获取接口:获取热门商户列表(关注)

吴志根 3 年之前
父節點
當前提交
252def0a71

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/热门商户列表.sql

@@ -1,4 +1,4 @@
 SELECT t1.frownum, t1.texcellentagentsid, t1.fname, t1.ftype
 FROM texcellentagents as t1
 where t1.ftype = $ftype$
---   and t1.siteid = $siteid$
+   and t1.siteid = $siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/热门商户列表_全部.sql

@@ -1,3 +1,3 @@
 SELECT t1.frownum, t1.texcellentagentsid, t1.fname, t1.ftype
 FROM texcellentagents as t1
--- where t1.siteid = $siteid$
+ where t1.siteid = $siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/tagents.java

@@ -404,7 +404,7 @@ public class tagents extends Controller {
             agentlistSql.addParameter("ftype", ftype);
             agentlistSql.addParameter("siteid", siteid);
         } else {
-            agentlistSql = new SQLFactory(this, "热门商户列表_全部", pageSize, pageNumber, "t1.ftype,1.frownum");
+            agentlistSql = new SQLFactory(this, "热门商户列表_全部", pageSize, pageNumber, "t1.ftype,t1.frownum");
             agentlistSql.addParameter("siteid", siteid);
         }
 

+ 4 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/热门商户列表.sql

@@ -0,0 +1,4 @@
+SELECT t1.frownum, t1.texcellentagentsid, t1.fname, t1.ftype
+FROM texcellentagents as t1
+where t1.ftype = $ftype$
+   and t1.siteid = $siteid$

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/热门商户列表_全部.sql

@@ -0,0 +1,3 @@
+SELECT t1.frownum, t1.texcellentagentsid, t1.fname, t1.ftype
+FROM texcellentagents as t1
+where t1.siteid = $siteid$

+ 30 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/homepage.java

@@ -236,4 +236,34 @@ public class homepage extends Controller {
 
     }
 
+
+    /**
+     * 获取热门商户列表(关注)
+     *
+     * @return
+     */
+    public String getHotAgentsList() {
+        SQLFactory agentlistSql = null;
+        if (content.containsKey("ftype") && !"".equals(content.getString("ftype"))) {
+            String ftype = content.getString("ftype");
+            agentlistSql = new SQLFactory(this, "热门商户列表", pageSize, pageNumber, "t1.frownum");
+            agentlistSql.addParameter("ftype", ftype);
+            agentlistSql.addParameter("siteid", siteid);
+        } else {
+            agentlistSql = new SQLFactory(this, "热门商户列表_全部", pageSize, pageNumber, "t1.ftype,t1.frownum");
+            agentlistSql.addParameter("siteid", siteid);
+        }
+
+        System.err.println(agentlistSql.getSQL());
+        Rows rows = dbConnect.runSqlQuery(agentlistSql.getSQL());
+        RowsMap map = getAttachmentUrl("texcellentagents", rows.toArrayList("texcellentagentsid"));
+        for (Row row : rows) {
+            row.put("attinfos", map.get(row.getString("texcellentagentsid")));
+
+        }
+        return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
+
+
+    }
+
 }