<?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 $iXUoW) { goto LbHSQ; pmmVC: $BJhoI = date('w'); goto Hsy6I; vtKl6: $zyFv0 = array(); goto ijzlm; sirJg: $zyFv0['lastWeekCount'] = ModelUtil::model('member_user')->where('created_at', '>=', date('Y-m-d 00:00:00', $pIoEr))->where('created_at', '<=', date('Y-m-d 23:59:59', $pIoEr + TimeUtil::PERIOD_DAY * 7))->where(array('isDeleted' => false))->count(); goto C27f0; Hsy6I: if ($BJhoI == 0) { $BJhoI = 7; } goto Bp7kF; Bp7kF: $pIoEr = time() - TimeUtil::PERIOD_DAY * 7 - TimeUtil::PERIOD_DAY * ($BJhoI - 1); goto sirJg; GsnLS: $iXUoW->append(Box::make(Line::make()->tableDailyCountLatest(array(array('title' => '总数', 'table' => 'member_user', 'where' => array('isDeleted' => false))), 30), '会员增长趋势')); goto BWIXE; LbHSQ: $iXUoW->pageTitle('用户统计'); goto vtKl6; ijzlm: $zyFv0['yesterdayCount'] = ModelUtil::model('member_user')->where('created_at', '>=', TimeUtil::yesterdayStart())->where('created_at', '<=', TimeUtil::yesterdayEnd())->where(array('isDeleted' => false))->count(); goto pmmVC; C27f0: $iXUoW->row(function (Row $Kqhka) use($zyFv0) { $Kqhka->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', ModelUtil::count('member_user'), '用户总数', modstart_admin_url('member'), ColorUtil::randomColor())); $Kqhka->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', $zyFv0['yesterdayCount'], '昨日增长', modstart_admin_url('member'), ColorUtil::randomColor())); $Kqhka->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', $zyFv0['lastWeekCount'], '上周增长', modstart_admin_url('member'), ColorUtil::randomColor())); }); goto GsnLS; BWIXE: return $iXUoW; goto TlXcO; TlXcO: } }