联系官方销售客服
1835022288
028-61286886
循环字段内容,怎么让重复的字段内容只显示一个,比如多个文章含有北京市,只显示一个北京市
{module module=news field=xuanzediqu IN_link_id=0,-1 order=displayorder_desc,updatetime num=10 } <a href="" rel="nofollow" class="">{dr_linkage('address', $t['xuanzediqu'], 0, 'name')}</a> {/module}
我这么写好像不管用,怎么才能实现呢
mysqli_sql_exception #3065
Expression #1 of ORDER BY clause is not in SELECT list, references column 'aaajiaoyou.dr_1_news.updatetime' which is not in SELECT list; this is incompatible with DISTINCT 搜索问题 →
SELECT DISTINCT `dr_1_news`.`xuanzediqu` FROM `dr_1_news` WHERE `dr_1_news`.`link_id` IN (0,-1) AND `dr_1_news`.`status` = 9 ORDER BY `dr_1_news`.`updatetime` DESC LIMIT 10页面提示这个
mysqli_sql_exception #3065
Expression #1 of ORDER BY clause is not in SELECT list, references column 'aaajiaoyou.dr_1_news.updatetime' which is not in SELECT list; this is incompatible with DISTINCT 搜索问题 →
SELECT DISTINCT `dr_1_news`.`xuanzediqu`,`dr_1_news`.`title`,`dr_1_news`.`url`,`dr_1_news`.`id`,`dr_1_news`.`flbq`,`dr_1_news`.`fuwujiage`,`dr_1_news`.`thumb`,`dr_1_news`.`keywords`,`dr_1_news`.`description` FROM `dr_1_news` WHERE `dr_1_news`.`link_id` IN (0,-1) AND `dr_1_news`.`status` = 9 ORDER BY `dr_1_news`.`updatetime` DESC LIMIT 10跟之前的错误代码一样
标签里的字段也不用全写了,写一个需要被筛选的字段就可以了{module module=news field=DISTINCT_xuanzediqu IN_link_id=0,-1 order=updatetime num=10 } <a href="" rel="nofollow" class="">{dr_linkage('address', $t['xuanzediqu'], 0, 'name')}</a> {/module}