phpcms教程之增加统计代码可以统计每天发表文章数量
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."
";
$end = $daystart;
$i++;
}
}
}
本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!