JEECMS V5 副欄目功能,前臺顯示子欄目和副欄目
阿新 • • 發佈:2019-01-07
ContentDaoImpl.java 中
byChannelIds 方法
else if(option==3) { //包含子欄目和副欄目 f.append("select bean from Content bean"); f.append(" join bean.contentExt as ext"); f.append(" join bean.channels as channel"); f.append(" where channel.id in(select ch.id from Channel as ch,"); f.append(" Channel ch2 where ch.lft between ch2.lft and"); f.append(" ch2.rgt and ch2.id=:channelId )"); f.setParam("channelId", channelIds[0]); }
AbstractContentDirective.java
getChannelOption 方法
Integer option = DirectiveUtils.getInt(PARAM_CHANNEL_OPTION, params);
if (option == null || option < 0 || option > 3) {
return 0;
} else {
return option;
}
模板中 channelOption='3'