dedecms的list标签orderby属性只支持按一个字段排序,假如想多个字段排序的话,就需要对PHP举办修改,使其可以支持多字段排序,修改如下:
打开include/arc.listview.class.php,找到:
01 |
//假如不消默认的sortrank或 id 排序,利用连系查询(数据量大时很是迟钝) |
02 |
if (preg_match( '/hot|click|lastpost|title/' , $orderby)) |
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 |
07 |
FROM `js_archives` arc |
08 |
LEFT JOIN `js_arctype` tp ON arc.typeid=tp. id |
10 |
WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row"; |
|