Home > php教程 > PHP源码 > phpcms 查询每日发表内容

phpcms 查询每日发表内容

PHP中文网
Release: 2016-05-25 17:00:11
Original
1093 people have browsed it

phpcms 查询每日发表内容

<?php


defined(&#39;IN_PHPCMS&#39;) or exit(&#39;No permission resources.&#39;);

class tongji{

    function __construct(){

        $this->db = pc_base::load_model("news_model");

    }

    function postnum(){

        $end = $_GET[&#39;end&#39;] ? strtotime($_GET[&#39;end&#39;]) : time();

        $i = 0;

        while($i < 10){

            $daystart = strtotime(" -1 day",$end);

            $dayend = $end; 

            $where = "inputtime > $daystart and inputtime < $dayend ";


            $number = $this->db->count($where);

            echo date("Y-m-d",$daystart)."发表了".$number."<br/>";

            $end = $daystart;

            $i++;

            

        }

    }

}
Copy after login

 以上就是phpcms 查询每日发表内容的内容,更多相关内容请关注PHP中文网(www.php.cn)!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template