主题 : 为什么子站的会读取到主站的数据,帖子勾选推荐后,居然主站也会读取到子站的推荐数据。。
级别: 白丁
UID: 59431
积分:82 加为好友
威望: 0 精华: 0
主题:6 回复:35
注册时间:2014-03-20
在线时长:0
1#   发表于:2014-06-24 17:05:46  IP:218.9.*.*
我有中文版和英文版2个站点
中文版是主站
英文版是子站

中文版内容已经基本配置完成,回头看了下英文版发现怎么会一堆中文的内容配置信息,然后才发觉读取到了中文版的内容

到底哪里出了问题?
级别: 总版主
UID: 10736
积分:148507 加为好友
威望: 205 精华: 42
主题:287 回复:126213
注册时间:2010-09-08
在线时长:17.91
2#   发表于:2014-06-24 17:13:21  IP:182.215.*.*
您有英文的模板吗
路漫漫其修远兮,吾将上下而求索!
级别: 白丁
UID: 59431
积分:82 加为好友
威望: 0 精华: 0
主题:6 回复:35
注册时间:2014-03-20
在线时长:0
3#   发表于:2014-06-24 17:17:29  IP:218.9.*.*
模版没有任何问题,我发现似乎是因为我改造了一个地方导致的 :

private Finder byChannelIds(Integer[] channelIds, Integer[] typeIds,
Boolean titleImg, Boolean recommend, String title, int orderBy,
int option) {
Finder f = Finder.create();
int len = channelIds.length;
// 如果多个栏目
if (option == 0 || len > 1) {
f.append("select bean from Content bean");
f.append(" join bean.contentExt as ext");
if (len == 1) {
f.append(" where bean.channel.id=:channelId");
f.setParam("channelId", channelIds[0]);
} else {
f.append(" where bean.channel.id in (:channelIds)");
f.setParamList("channelIds", channelIds);
}
} else if (option == 1) {
// 包含子栏目
f.append("select bean from Content bean");
f.append(" join bean.contentExt as ext");
f.append(" join bean.channel node,Channel parent");
f.append(" where node.lft between parent.lft and parent.rgt");
f.append(" and bean.site.id=parent.site.id");
f.append(" and parent.id=:channelId");
f.setParam("channelId", channelIds[0]);
} else if (option == 2) {
// 包含副栏目
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=:channelId");
f.setParam("channelId", channelIds[0]);
} 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]); 

  else {
throw new RuntimeException("option value must be 0 or 1 or 2 OR 3.");
}
if (titleImg != null) {
f.append(" and bean.hasTitleImg=:titleImg");
f.setParam("titleImg", titleImg);
}
if (recommend != null) {
f.append(" and bean.recommend=:recommend");
f.setParam("recommend", recommend);
}
appendReleaseDate(f);
appendTypeIds(f, typeIds);
f.append(" and bean.status=" + ContentCheck.CHECKED);
if (!StringUtils.isBlank(title)) {
f.append(" and bean.contentExt.title like :title");
f.setParam("title", "%" + title + "%");
}
appendOrder(f, orderBy);
return f;
}


在else if(option==3) {
//包含子栏目和副栏目

时候里面的语句似乎过滤的有问题

您可以指导下该如何改么,因为有特别需求才需要这么展现的。
级别: 状元
UID: 33380
积分:50625 加为好友
威望: 21 精华: 3
主题:88 回复:30687
注册时间:2012-05-07
在线时长:0
4#   发表于:2014-06-24 17:19:54  IP:182.215.*.*
你那上面标签都是你自己写的?我这也看不到您什么效果呀
功成由勤,业精于勤。
级别: 白丁
UID: 59431
积分:82 加为好友
威望: 0 精华: 0
主题:6 回复:35
注册时间:2014-03-20
在线时长:0
5#   发表于:2014-06-24 17:23:59  IP:218.9.*.*
     <div>
            <h3 class="hot_1"><a href="/MoreSolutions/index.jhtml"></a></h3>
            [@cms_content_list count='3' titLen='18' orderBy='4' channelOption='1' channelId='192']
            [#list tag_list as a]
            [#if a.recommend]
            <h2><a href="${a.url}" title="${a.title}" target="_blank">[@text_cut s=a.title len=titLen append="..."/]</a></h2>
            [/#if]
            [/#list]
            [/@cms_content_list]
            <span><a href="/MoreSolutions/index.jhtml">More</a></span>
        </div>

不是标签,就是把channelOption=“1”的,改成3,增加了3的值,让可以同时读取出副栏目和子栏目
级别: 状元
UID: 33380
积分:50625 加为好友
威望: 21 精华: 3
主题:88 回复:30687
注册时间:2012-05-07
在线时长:0
6#   发表于:2014-06-24 17:28:11  IP:182.215.*.*
包含3这个你是否有效?能取出吗子栏目和副栏目吗
功成由勤,业精于勤。
级别: 白丁
UID: 59431
积分:82 加为好友
威望: 0 精华: 0
主题:6 回复:35
注册时间:2014-03-20
在线时长:0
7#   发表于:2014-06-24 17:31:31  IP:218.9.*.*
可以的,我估计是漏了这句sql
f.append(" and bean.site.id=parent.site.id");
模仿option=1的语句
级别: 状元
UID: 33380
积分:50625 加为好友
威望: 21 精华: 3
主题:88 回复:30687
注册时间:2012-05-07
在线时长:0
8#   发表于:2014-06-24 17:35:09  IP:182.215.*.*
f.append(" and bean.site.id=parent.site.id"); 把这个加上去试试
功成由勤,业精于勤。
级别: 白丁
UID: 59431
积分:82 加为好友
威望: 0 精华: 0
主题:6 回复:35
注册时间:2014-03-20
在线时长:0
9#   发表于:2014-06-24 17:44:45  IP:218.9.*.*
已经可以了,我自己搞定了,就是少了我发的那句也就是你回复的
也很郁闷啊,你们功能不完善,研究了半天,尤其是副栏目
级别: 状元
UID: 33380
积分:50625 加为好友
威望: 21 精华: 3
主题:88 回复:30687
注册时间:2012-05-07
在线时长:0
10#   发表于:2014-06-25 08:54:48  IP:182.215.*.*
功成由勤,业精于勤。
1 共1页