<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

DEDECMS给list标签加上多字段排序功能

时间:2020-12-09

dedecms的list标签orderby属性只支持按一个字段排序,假如想多个字段排序的话,就需要对PHP举办修改,使其可以支持多字段排序,修改如下:

打开include/arc.listview.class.php,找到:
 

01 //假如不消默认的sortrank或id排序,利用连系查询(数据量大时很是迟钝)
02        if(preg_match('/hot|click|lastpost|title/', $orderby))
03        {
04            $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,
05           tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
06           $addField
07           FROM `js_archives` arc
08           LEFT JOIN `js_arctype` tp ON arc.typeid=tp.id
09           $addJoin
10           WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row";
11        }
12        
0