SF专业版公告分页

作者:罗刚 来源:本站原创 点击数: 发布时间:2011年03月01日

问题:默认SF3.6专业版公告分页,前台能正常显示分页标签但是不能实现分页。

原因:“显示公告栏目循环列表信息_分页”标签查询语句有问题,导致都是显示前面的信息。

解决方法:后台管理 >> 系统设置 >> 模板标签管理 >> 标签管理,找到“显示公告栏目循环列表信息_分页” 标签,点击修改,进入到“标签查询设置”系统默认的查询语句是:

SELECT TOP @pagesize C.*,A.* FROM PE_CommonModel C INNER JOIN PE_U_Announce A ON C.ItemID=A.ID WHERE C.GeneralID NOT IN(SELECT TOP @startrow IC.GeneralID  FROM PE_CommonModel IC INNER JOIN PE_U_Announce IA ON IC.ItemID=IA.ID WHERE IC.NodeID in (@nodeArray) AND IC.TableName='PE_U_Announce' AND IC.Status = 99 AND (DATEADD(d, IA.OutTime, IA.DateAndTime) >= GETDATE()) OR IC.NodeID in (@nodeArray) AND IC.TableName='PE_U_Announce' AND IC.Status = 99 AND IA.OutTime=0 ORDER BY IA.DateAndTime DESC) AND C.NodeID in (@nodeArray) AND C.TableName='PE_U_Announce' AND C.Status = 99 AND (DATEADD(d, A.OutTime, A.DateAndTime) >= GETDATE()) OR C.NodeID in (@nodeArray) AND C.TableName='PE_U_Announce' AND C.Status = 99 AND C.SigninType!=2 AND A.OutTime=0 ORDER BY A.DateAndTime DESC

我们只需要去掉红色部分变成

SELECT TOP @pagesize C.*,A.* FROM PE_CommonModel C INNER JOIN PE_U_Announce A ON C.ItemID=A.ID WHERE C.GeneralID NOT IN(SELECT TOP @startrow IC.GeneralID  FROM PE_CommonModel IC INNER JOIN PE_U_Announce IA ON IC.ItemID=IA.ID WHERE IC.NodeID in (@nodeArray) AND IC.TableName='PE_U_Announce' AND IC.Status = 99 AND  IC.NodeID in (@nodeArray) AND IC.TableName='PE_U_Announce' AND IC.Status = 99 AND IA.OutTime=0 ORDER BY IA.DateAndTime DESC) AND C.NodeID in (@nodeArray) AND C.TableName='PE_U_Announce' AND C.Status = 99 AND  C.NodeID in (@nodeArray) AND C.TableName='PE_U_Announce' AND C.Status = 99 AND C.SigninType!=2 AND A.OutTime=0 ORDER BY A.DateAndTime DESC

点击保存,这样在前台就能实现分页了