dedecms5.7会员空间文章列表分页一直显示为0条记录

在用dedecms做二次开发的时候发现会员的文章列表页下面的文章分页一直显示的都是 共 0 页/0条记录 ,才发现是程序出了问题。跟踪代码才发现问题的所在是写的查询总数的正则是错误的,不知道是故意的还是忘记了在测试的时候忘记改过来...

要修改的程序文件为include/arc.memberlistview.class.php

138行源代码为:

if($this->totalResult==0)
        {
            //$this->isQuery = true;
            //$this->dsql->Execute('mbdl',$this->sourceSql);
            //$this->totalResult = $this->dsql->GetTotalRow('mbdl');
            $countQuery = preg_replace("/select[ \r\n\t](.*)[ \r\n\t]from/i","Select count(*) as dd From",$this->sourceSql);
            $row = $this->dsql->GetOne($countQuery);
            $row['dd'] = empty($row['dd']) ? 0 : $row['dd'];
            $this->totalResult = $row['dd'];
            $this->sourceSql .= " limit 0,".$this->pageSize;
        }


修改为:

if($this->totalResult==0)
        {
            $this->isQuery = true;
            $this->dsql->Execute('mbdl',$this->sourceSql);
            $this->totalResult = $this->dsql->GetTotalRow('mbdl');
            $this->sourceSql .= " limit 0,".$this->pageSize;
        }



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值