聯系官方銷售客服
1835022288
028-61286886
后臺在模塊中新增了一個字段為pmzd,該字段用數字表達,用于顯示排名的。
現在想在列表中,讓數據通過這個字段的結果來進行從小到大的排序與分頁(越小越靠前),請問要怎么調用?
我試了這兩種方法都不行,沒有按照這個字段的大小去排序,麻煩請指點一下。
<a href="{Router::search_url($params, 'order', 'pmzd')}" class="mr20 fll tab posr {if $params.order=='pmzd'}on{/if}">排行榜</a> {module catid=$catid order=pmzd page=1} {/module} {$pages}
首先,search_url只能用在search頁面,而module標簽無法用到search,所以你這樣組合就矛盾了
應該改成
在搜索頁面使用把module改成search標簽的標準格式就對了
回復@外聘專員-北京老祈
科室我search頁面這么寫也讀取的不對呀,沒按自定義中的數字排序來走。
{search module=MOD_DIR id=$searchid total=$sototal order=pmzd catid=$catid page=1 pagesize=16 urlrule=$urlrule}
1 pmzd是不是模塊內容字段
2 debug輸出下看看到底為什么沒效果