联系官方销售客服
1835022288
028-61286886
A模块通过字段关联B模块的内容怎么排除重复的内容,多个重复内容只显示一条,通过下面的排除没有效果
{module module=baike kid=$kid field=DISTINCT_title,url,id IN_link_id=0,-1} {$t.title} {/module}
调用出来的标题还是很多条重复的
诊断信息
标签解析:{list action=module module=baike kid=888 field=DISTINCT_title,url,id IN_link_id=0,-1} 查询解析: SELECT DISTINCT `dr_1_baike`.`title`,`dr_1_baike`.`url`,`dr_1_baike`.`id` FROM `dr_1_baike` WHERE `dr_1_baike`.`kid` = 888 AND `dr_1_baike`.`link_id` IN (0,-1) ORDER BY `dr_1_baike`.`updatetime` DESC
建议用分组去重 group by
SELECT `dr_1_news`.`title`,`dr_1_news`.`url`,`dr_1_news`.`id` FROM `dr_1_news` WHERE `dr_1_news`.`kid` = 888 AND `dr_1_news`.`link_id` IN (0,-1) GROUP BY `dr_1_news`.`title` ORDER BY `dr_1_news`.`updatetime` DESC
迅睿框架技术-陈老师