聯(lián)系官方銷售客服
1835022288
028-61286886
搜索結果界面,我想在后臺加個變量判斷,變量勾了是就id升序,勾了否就id降序排列;
我按照默認的寫法判斷了,出現(xiàn)的問題就是,search.html頁面默認的時間排序,點擊排序,價格高低排序都不能用了。
這個地方應該怎么寫判斷 才能不影響搜索頁面默認的篩選排序功能呢?
默認的搜索列表代碼
{search module=store id=$searchid total=$sototal order=$params.order catid=$catid page=1 pagesize=10 urlrule=$urlrule return=r} {/search}
我改的有問題的判斷
{if dr_var_value('paixu')} {search module=store id=$searchid total=$sototal order=id_desc catid=$catid page=1 pagesize=10 urlrule=$urlrule return=r} {/search} {else} {search module=store id=$searchid total=$sototal order=id_asc catid=$catid page=1 pagesize=10 urlrule=$urlrule return=r} {/search} {/if}
這個表示按id排序
回復迅睿框架創(chuàng)始人
我在后臺加個變量,想通過變量的值來控制列表默認打開的商品排序是
order=id_asc
order=id_desc
但是不能影響search.html 默認的排序功能(如下功能)
請問 這個應該怎么處理才能實現(xiàn)呢?
按demo文檔的寫法吧
回復@志偉 請問你的問題解決了嗎?是怎么解決的?
回復@pufei889
用js前端拼接搜索url,然后在后面加上order=id_desc