<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Layout\AdminPage; use ModStart\Admin\Widget\DashboardItemA; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\ColorUtil; use ModStart\Core\Util\TimeUtil; use ModStart\Layout\Row; use ModStart\Widget\Box; use ModStart\Widget\Chart\Line; class MemberDashboardController extends Controller { public function index(AdminPage $JcqUq) { goto i43yL; HtbZj: $q8cE5 = array(); goto nxqqy; i43yL: $JcqUq->pageTitle('用户统计'); goto HtbZj; uqAaF: if ($D2h4f == 0) { $D2h4f = 7; } goto tARe8; zm2IA: return $JcqUq; goto RWAm4; KdfRH: $D2h4f = date('w'); goto uqAaF; vOViP: $JcqUq->row(function (Row $AO3Sv) use($q8cE5) { $AO3Sv->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', ModelUtil::count('member_user'), '用户总数', modstart_admin_url('member'), ColorUtil::randomColor())); $AO3Sv->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', $q8cE5['yesterdayCount'], '昨日增长', modstart_admin_url('member'), ColorUtil::randomColor())); $AO3Sv->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', $q8cE5['lastWeekCount'], '上周增长', modstart_admin_url('member'), ColorUtil::randomColor())); }); goto B4KiW; B4KiW: $JcqUq->append(Box::make(Line::make()->tableDailyCountLatest(array(array('title' => '总数', 'table' => 'member_user')), 30), '会员增长趋势')); goto zm2IA; tARe8: $DiOYd = time() - TimeUtil::PERIOD_DAY * 7 - TimeUtil::PERIOD_DAY * ($D2h4f - 1); goto iW1SW; nxqqy: $q8cE5['yesterdayCount'] = ModelUtil::model('member_user')->where('created_at', '>=', TimeUtil::yesterdayStart())->where('created_at', '<=', TimeUtil::yesterdayEnd())->count(); goto KdfRH; iW1SW: $q8cE5['lastWeekCount'] = ModelUtil::model('member_user')->where('created_at', '>=', date('Y-m-d 00:00:00', $DiOYd))->where('created_at', '<=', date('Y-m-d 23:59:59', $DiOYd + TimeUtil::PERIOD_DAY * 7))->count(); goto vOViP; RWAm4: } }