dedecms织梦系统如何按照软件下载次数排序?
作者:admin发布时间:2021-11-03分类:软件教程浏览:评论:0
导读:dedecms织梦的arclist标签可以按照文章点击次数、发布日期、得分等进行排序,今天有个客户需要按照软件下载次数进行排列,于是做了简单二次开发,首先找到include目录下面的taglib目录里的arclist.lib.php文件在376行后加入如下代码 if($orderby=='down')&
dedecms织梦cms的arclist标识能够依照文章内容点一下频次,公布日期,评分等开展排列,今日有一个顾客要求依照软件免费下载频次开展排序,因此干了简易二次开发,最先寻找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.')';
}
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.')';
}
标签:dedecms
相关推荐
你 发表评论:
欢迎- 软件教程排行