<?php
namespace application\admin\controller;
class total extends auth {
public function member_count() {
$member = db('member');
$month_where = strtotime('-1 month') . ' AND ' . time(); $week_where = strtotime('-1 week') . ' AND ' . time();
$yesterday_where = strtotime(date("Y-m-d", strtotime("-1 day"))) . ' AND ' . strtotime(date("Y-m-d")); $today_where = strtotime(date("Y-m-d")) . ' AND ' . time();
$member_total['total'] = $member->total();
$member_total['month_total'] = $member->where("regdate BETWEEN $month_where")->total();
$member_total['week_total'] = $member->where("regdate BETWEEN $week_where")->total();
$member_total['yesterday_total'] = $member->where("regdate BETWEEN $yesterday_where")->total();
$member_total['today_total'] = $member->where("regdate BETWEEN $today_where")->total();
return $member_total;
}
public function content_count() {
$content = db('content');
$month_where = strtotime('-1 month') . ' AND ' . time(); $week_where = strtotime('-1 week') . ' AND ' . time();
$yesterday_where = strtotime(date("Y-m-d", strtotime("-1 day"))) . ' AND ' . strtotime(date("Y-m-d")); $today_where = strtotime(date("Y-m-d")) . ' AND ' . time();
$content_total['total'] = $content->total();
$content_total['month_total'] = $content->where("inputtime BETWEEN $month_where")->total();
$content_total['week_total'] = $content->where("inputtime BETWEEN $week_where")->total();
$content_total['yesterday_total'] = $content->where("inputtime BETWEEN $yesterday_where")->total();
$content_total['today_total'] = $content->where("inputtime BETWEEN $today_where")->total();
return $content_total;
}
}