Home >php教程 >PHP源码 >计算访问次数。

计算访问次数。

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:32:311127browse
跳至 [1] [全屏预览]
$last_view = session('last_view_service');
        $time = time();
        if ($last_view + 10 < $time) { //每10秒计算一次。10秒内访问算一次
            $data['uid'] = $this->uid;
            $data['type'] = 'service';
            $data['row_id'] = $aId;
            $data['to_uid'] = $service['uid'];
            D('WekoStat')->addVisit($data);
            session('last_view_service', $time, 20);
        }
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn