业务经理

微信扫描以上二维码

028-61286886

技术咨询

网站首页如何调用总的hits,就是每个内容页的阅读量总和

开源系统 更新 2021-03-24 18:40:14 迅睿粉丝

网站首页如何调用总的hits,就是每个内容页的阅读量总和

方案

  • 迅睿粉丝 #1 · 2018-11-26 10:18:02
    满意答案
    {php $ci->db->select_sum('hits');$row = $this->db->get('1_news')->row_array; echo $row['hits'];}
    随便写的,效率不高,需要优化一下
  • 迅睿粉丝 #2 · 2018-11-26 10:40:21
    诚接二开/定制/使用解答 报错了大哥。
  • 迅睿粉丝 #3 · 2018-11-26 10:42:07
    什么错
  • 迅睿粉丝 #4 · 2018-11-26 10:42:10
    诚接二开/定制/使用解答 报错了大哥。诚接二开/定制/使用解答 我用的共享模块
  • 迅睿粉丝 #5 · 2018-11-26 10:43:52
    诚接二开/定制/使用解答 报错了大哥。诚接二开/定制/使用解答 我用的共享模块诚接二开/定制/使用解答

    An uncaught Exception was encountered

    Type: Error

    Message: Call to a member function get() on null

    Filename: /www/wwwroot/cache/templates/templates.pc.default.home.right.html.cache.php

    Line Number: 21

    Backtrace:

    File: /www/wwwroot/cache/templates/templates.pc.default.home.index.html.cache.php
    Line: 45
    Function: include

    File: /www/wwwroot/diy/dayrui/libraries/Template.php
    Line: 234
    Function: include

    File: /www/wwwroot/diy/branch/fqb/D_Common.php
    Line: 3006
    Function: display

    File: /www/wwwroot/diy/dayrui/controllers/Home.php
    Line: 15
    Function: _indexc

    File: /www/wwwroot/diy/Init.php
    Line: 72
    Function: require

    File: /www/wwwroot/index.php
    Line: 49
    Function: require

  • 迅睿粉丝 #6 · 2018-11-26 11:37:02
    诚接二开/定制/使用解答老兄 能解决吗?
  • 迅睿粉丝 #7 · 2018-11-26 12:42:47
    this改成ci
  • 迅睿粉丝 #8 · 2018-11-26 13:07:26
    诚接二开/定制/使用解答 设为满意答案
    {php $ci->db->select_sum('hits');$row = $ci->db->get('1_news')->row_array; echo $row['hits'];}
    数据不显示了。。
  • 迅睿粉丝 #9 · 2020-07-15 09:35:13
    老哥解决了没 我也遇到这个问题
  • 迅睿粉丝 #10 · 2020-07-15 09:44:09
    辰和科技 都忘记了,之前好像没有调用出来 然后就换了模板了好像是 你不然就发一个问题 看大神的回复
  • 迅睿粉丝 #11 · 2020-07-15 10:50:51
    菜狗 啊我搞好了 其实用自带的标签就可以统计了 哈哈哈我发完才看到这都是18年的问题了,感谢回复
  • 迅睿粉丝 #12 · 2020-07-15 15:47:55
    辰和科技 咋解决的呀?
  • 迅睿粉丝 #13 · 2020-07-16 17:57:46
    菜狗{$q=0}{hits module=MOD_DIR catid=0}<span style="display:none">{$q=$q+$t.hits}</span>{/hits}{$q}q的结果就是所有文章访问量总和
  • 迅睿粉丝 #14 · 2021-03-24 18:40:14
    @诚接二开/定制/使用解答:感谢你的回复 我已经满意解决

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关