在mobile/include/mall.inc.php 行60 $order = $MOD['order'];
之前增加 排序方式判断 如果有order参数则$order接受参数,没有就用默认 $order = $MOD['order'];
1、增加排序以后的mobileurl函数,伪静态规则
function mobileurl($moduleid, $catid = 0, $itemid = 0, $page = 1, $areaid=0, $order=0) { //if(RE_WRITE) return $moduleid.'-'.$catid.'-'.$itemid.'-'.$page.'.html'; if(RE_WRITE) return $moduleid.'-'.$catid.'-'.$itemid.'-'.$areaid.'-'.$order.'-'.$page.'.html'; //edit by dp 12-03 for $areaid if($itemid) { return 'index.php?order='.$order.'&areaid='.$areaid.'&moduleid='.$moduleid.'&itemid='.$itemid.($page > 1 ? '&page='.$page : ''); } else if($catid) { return 'index.php?order='.$order.'&areaid='.$areaid.'&moduleid='.$moduleid.'&catid='.$catid.($page > 1 ? '&page='.$page : ''); } else { return 'index.php?order='.$order.'&areaid='.$areaid.'&moduleid='.$moduleid.($page > 1 ? '&page='.$page : ''); } }
伪静态规则
<rule name="destoon_rewrite_8"> <match url="^(.*)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$" /> <action type="Rewrite" url="{R:1}/index.php?moduleid={R:2}&catid={R:3}&itemid={R:4}&page={R:7}&areaid={R:5}&order={R:6}" /> </rule>
2、模板链接
保留当前分类id 城市id 0-综合排序,1-按时间倒序,2-价格低到高,3-价格高到低,4-销量倒序
<div class="p-35 f-l sort-sel ss-js"> <span class="sort-tt border-r-1 redStyle s-one"><em class="sort-t">综合排序</em><i></i></span> <ul class="sort-ul"> <li><a href="{mobileurl(16, $catid,0,1,$areaid,0)}" data-ajax='false' >综合排序</a></li> <li><a href="{mobileurl(16, $catid,0,1,$areaid,1)}" data-ajax='false' >最新发布</a></li> <li><a href="{mobileurl(16, $catid,0,1,$areaid,2)}" data-ajax='false' >价格由低到高</a></li> <li><a href="{mobileurl(16, $catid,0,1,$areaid,3)}" data-ajax='false' >价格由高到低</a></li> </ul> </div> <div class="p-25 f-l ss-js"> <span class="sort-tt border-r-1 s-xl"><a href="{mobileurl(16, $catid,0,1,$areaid,4)}" data-ajax='false' >销量优先</a></span> </div>
3、mobile/include/mall.inc.php 行60 $order = $MOD['order']; 改成