极致JIZHICMS点击量hits的标签使用说明及注意事项
极致CMS网站hits点击量使用方法
点击量一般存储在 hits
字段中,在内容、商品或者自定义模型中都会自带这个字段。
常用调用
列表通用
{foreach $lists as $v} 点击量/阅读量:{$v['hits']} {/foreach}
文章模型详情页
{fun incrData('article',$jz['id'],'hits')}
商品模型详情页
{fun incrData('product',$jz['id'],'hits')}
自定义模型详情页
{fun incrData($jz['molds'],$jz['id'],'hits')} //通用
静态html中动态调用
<span id="read-num">热度 {$jz['hits']}</span> <script>$.get('/common/gohits?molds={$jz['molds']}&id={$jz['id']}',function(r){ $("#read-num").html('热度 '+r); })</script>
文章模型把 $jz['molds'] 换成 'article'
本文属原创,转载请注明原文:http://www.zhimatong.com/jiaocheng/896.html
为保证教程的实用性及扩大知识面覆盖,如果您有相似问题而未解决,可联系在线客服免费技术支持。
点赞 1