加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > CMS系统 > Dedecms > 正文

织梦列表页list标签weight权重排序方法

发布时间:2020-12-14 04:43:07 所属栏目:Dedecms 来源:网络整理
导读:织梦列表页list标签weight权重排序方法:(注:红色标记部分就是修改处) 1、打开include/arc.listview.class.php 2、找到?else if($orderby=="lastpost") { ??????????? $ordersql = "? ORDER BY arc.lastpost $orderWay"; ??????? } ???替换 ??????? else

织梦列表页list标签weight权重排序方法:(注:红色标记部分就是修改处)

1、打开include/arc.listview.class.php

2、找到?else if($orderby=="lastpost") {

??????????? $ordersql = "? ORDER BY arc.lastpost $orderWay";

??????? }

???替换

??????? else if($orderby=="lastpost") {

??????????? $ordersql = "? ORDER BY arc.lastpost $orderWay";

??????? }

???????else if($orderby=="weight") {

??????????? $ordersql = "? ORDER BY arc.weight $orderWay";

??????? }

???????

3、找到

???? //如果不用默认的sortrank或id排序,使用联合查询(数据量大时非常缓慢)

??????? if(preg_match('/hot|click|lastpost/',$orderby))

???替换

  //如果不用默认的sortrank或id排序,使用联合查询(数据量大时非常缓慢)

??   if(preg_match('/hot|click|lastpost|weight/',$orderby))

4、找到$query = "SELECT id FROM `dede_arctiny` arc WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row ";

??????替换$query = "SELECT id FROM `dede_archives` arc WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row ";

5、标签调用:

  {dede:list orderby='weight' pagesize ='3'}

??? {/dede:list}

  接下来{dede:list}标签就支持了按权重排序的调用了。


(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读