织梦列表按照下载次数排序

打开/include/taglib/arclist.lib.php文件

找到376行后加入下面代码 

if($orderby == 'down') 

$sql = "select SUM(downloads) as down_num,id from dede_downloads group by id ORDER BY down_num DESC LIMIT 0,15"; 

$dsql->Execute('me',$sql); 

while($drow = $dsql->GetArray() ) 

$arr[] = $drow['id']; 

$dstr = implode(",",$arr); 

if($orwhere!='') 

$orwhere .= " AND arc.id in($dstr)"; 

}else{ 

$orwhere .= " where arc.id in($dstr)"; 

$ordersql = 'ORDER BY field(arc.id,'.$dstr.')'; 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wsfzzd.html