聯(lián)系官方銷售客服
1835022288
028-61286886
循環(huán)字段內(nèi)容,怎么讓重復(fù)的字段內(nèi)容只顯示一個,比如多個文章含有北京市,只顯示一個北京市
{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}
我這么寫好像不管用,怎么才能實現(xiàn)呢
官方提醒:使用module內(nèi)容循環(huán)標(biāo)簽的生成工具,填寫參數(shù)就可以生成相關(guān)的代碼,每個參數(shù)后面都有用法解釋
手冊里面有一個通配符,有個D字母開頭的參數(shù)是控制值的重復(fù)。度。
{module field=DISTINCT_title,url,id **
參考文檔:《過濾同步重復(fù)的內(nèi)容》
回復(fù)@迅??蚣芗夹g(shù)-劉和平
這么寫嗎,不好使而且還報系統(tǒng)故障了
你先按照這個方法在index.php文件中打開開發(fā)者模式:http://223987.com/doc/204.html
回復(fù)@迅??蚣芗夹g(shù)-劉和平
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
頁面提示這個
field助理需要把所有的在標(biāo)簽里面的字段都加上。
是說在你這個標(biāo)簽里面出現(xiàn)的字段全部都要寫到這個參數(shù)里面去。
回復(fù)@迅??蚣芗夹g(shù)-劉和平
試了好幾遍,還是不行
不行是報錯嗎?還是沒有數(shù)據(jù)了,如果報錯的話需要發(fā)一下錯誤提示。
回復(fù)@迅??蚣芗夹g(shù)-劉和平
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
跟之前的錯誤代碼一樣
參考文檔:《DISTINCT Expression #1 of ORDER BY clause is not in SELECT list, references column》
回復(fù)@迅睿框架技術(shù)-劉和平
可以了,mysql版本高了,在mysql配置文件里配置一下就可以了
標(biāo)簽里的字段也不用全寫了,寫一個需要被篩選的字段就可以了
{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}