<?php
use think\facade\Db;

function head() {
    $data = '<title>'.syscfg("site",'site_name').'</title>
	<meta charset="utf-8">
	<meta charset="UTF-8">
		<meta http-equiv="content-language" content="zh-cn" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<link rel="shortcut icon" href="/favicon.ico" />
		<meta name="keywords" content="'.syscfg("site",'site_seo_keywords').'" />
		<meta name="description" content="'.syscfg("site",'site_seo_desc').'" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<!--<meta name="viewport" content="width=device-width, initial-scale=1.0" />-->
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">';
	return ($data);
}

function countTime($limit) {
    
    foreach ($limit as $k => $v) {
        if(time() > strtotime($v['zctime'])){
            Db::name("site")->where(['id'=>$v['id']])->update(['status'=>0]);
        }
    }
    
}

function countData($ip) {
    $browse = Db::name("browse")->where(['ip'=>$ip])->find();
    if(!$browse) {
        Db::name("browse")->insert([
           'date' => time(),
           'ip' => $ip
        ]);
    }
    Db::name("llq")->insert([
        'date' => time()
    ]);
}