您好,登錄后才能下訂單哦!
<?php $url_info = "Admin/".CONTROLLER_NAME.'/'.ACTION_NAME; $send_count = M('SendCount'); $url = $send_count ->field('id,spendcount,request,maxrequest,minrequest') ->where("url='%s'",$url_info) ->find(); if(!empty($url)){ $times = round(microtime(true)-BEGIN_TIME,3); $serd['spendcount'] =$url['spendcount'] + 1; $serd['request'] =$url['request'] + 1; $serd['create_time'] = time(); $serd['minrequest'] = $times; $serd['maxrequest'] = $url['maxrequest'] > $url['minrequest'] ? $url['maxrequest'] : $url['minrequest']; M('SendCount')->where('id='.$url['id'].'')->save($serd); }else{ $times = round(microtime(true)-BEGIN_TIME,3); $serd['spendcount'] = 1; $serd['url'] = $url_info; $serd['request'] = $times; $serd['minrequest'] = $times; $serd['create_time'] = time(); $serd['type'] = 2; M('SendCount')->add($serd); } 入口文件需設(shè)置: define('BEGIN_TIME',microtime(true));
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。