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'