Browse Source

获取最新的管理端通告,获取门户广告位轮播图

吴志根 4 năm trước cách đây
mục cha
commit
09999767d1

+ 5 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/bannermag/SQL/广告位查询.sql

@@ -0,0 +1,5 @@
+select tbannerlocationid, flocation, fisused
+from tbannerlocation
+where siteid = $siteid$
+  and fclienttype = 'WEB'
+  and flocation LIKE('portal%')

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/bannermag/SQL/轮播图查询.sql

@@ -0,0 +1,3 @@
+select tbannermagid,tbannerlocationid,fhyperlink, flinktype,
+       fdatatable, fdataid from tbannermag
+where siteid=$siteid$ and fisused=1 and tbannerlocationid in $tbannerlocationid$

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

@@ -42,4 +42,29 @@ public class bannermag extends Controller {
         }
         return getSucReturnObject().setData(locationrows).toString();
     }
+
+    /**
+     * 获取门户广告位轮播图
+     *
+     * @return
+     */
+    public String getPortalBannerList() {
+        //fclienttype:web,MOBILE
+        SQLFactory locationSQL = new SQLFactory(this, "广告位查询");
+        locationSQL.addParameter("siteid", siteid);
+        Rows locationrows = dbConnect.runSqlQuery(locationSQL.getSQL());
+        SQLFactory bannerSQl = new SQLFactory(this, "轮播图查询");
+        bannerSQl.addParameter("siteid", siteid);
+        bannerSQl.addParameter_in("tbannerlocationid", locationrows.toArrayList("tbannerlocationid"));
+        RowsMap bannermap = dbConnect.runSqlQuery(bannerSQl.getSQL()).toRowsMap("tbannerlocationid");
+        for (Row locationrow : locationrows) {
+            Rows bannerRows = bannermap.get(locationrow.getString("tbannerlocationid"));
+            for (Row bannerrow : bannerRows) {
+                bannerrow.put("attinfos", getAttachmentUrl("tbannermag", bannerrow.getString("tbannermagid")));
+            }
+            locationrow.put("banner", bannerRows);
+        }
+        return getSucReturnObject().setData(locationrows).toString();
+    }
+
 }

+ 24 - 0
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/最新管理端发布的通告.sql

@@ -0,0 +1,24 @@
+SELECT t1.tnoticeid,
+       t1.ftype,
+       t1.ftitle,
+       t1.fsummary,
+       t1.fcontent,
+       t1.checkdate,
+       t1.fisontop,
+       t1.fbegdate,
+       t1.fenddate,
+       t1.fstatus,
+       t1.freadcount,
+       t1.checkby,
+       t1.fisagentsubuser,
+       t1.fischeckagent,
+       t1.fishomepage,
+       t1.fissingleagent,
+       t1.fisspecifiedrange,
+       t1.tenterprise_userid
+FROM tnotice AS t1
+WHERE GETDATE() BETWEEN t1.fbegdate AND t1.fenddate
+  AND t1.ftype = '¹Ù·½'
+  AND t1.fishomepage = 0
+  AND t1.fstatus = '·¢²¼'
+

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

@@ -170,4 +170,15 @@ public class homepage extends Controller {
         Rows rows = sql.runSqlQuery();
         return getSucReturnObject().setData(rows).toString();
     }
+
+
+    /**
+     * 获取管理端发布的最新通告
+     */
+    public String getNewestNoticeList() {
+        SQLFactory sql = new SQLFactory(this, "最新管理端发布的通告",pageSize,pageNumber,"t1.createdate DESC");
+        Rows rows = sql.runSqlQuery();
+        return getSucReturnObject().setDataByPaging(rows).preloading(1).toString();
+    }
+
 }