- <?php
- defined('IN_PHPCMS') or exit('No permission resources.');
- class tongji{
- function __construct(){
- $this->db = pc_base::load_model("news_model");
- }
- function postnum(){
- $end = $_GET['end'] ? strtotime($_GET['end']) : 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++;
- }
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/070320148902.html
来源: http://www.codesnippet.cn/detail/070320148902.html