<?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 $j13Tr) { goto fTLyW; fTLyW: $j13Tr->pageTitle('用户统计'); goto A9GVX; A9GVX: $H0Utq = array(); goto d7FOL; xwPH6: $H0Utq['lastWeekCount'] = ModelUtil::model('member_user')->where('created_at', '>=', date('Y-m-d 00:00:00', $ou507))->where('created_at', '<=', date('Y-m-d 23:59:59', $ou507 + TimeUtil::PERIOD_DAY * 7))->count(); goto YLoS5; c1QB6: $ou507 = time() - TimeUtil::PERIOD_DAY * 7 - TimeUtil::PERIOD_DAY * ($yHjNd - 1); goto xwPH6; fCGnx: if ($yHjNd == 0) { $yHjNd = 7; } goto c1QB6; ne2dJ: return $j13Tr; goto djeI5; G3GLw: $j13Tr->append(Box::make(Line::make()->tableDailyCountLatest(array(array('title' => '总数', 'table' => 'member_user')), 30), '会员增长趋势')); goto ne2dJ; d7FOL: $H0Utq['yesterdayCount'] = ModelUtil::model('member_user')->where('created_at', '>=', TimeUtil::yesterdayStart())->where('created_at', '<=', TimeUtil::yesterdayEnd())->count(); goto L4_iZ; L4_iZ: $yHjNd = date('w'); goto fCGnx; YLoS5: $j13Tr->row(function (Row $q0jG3) use($H0Utq) { $q0jG3->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', ModelUtil::count('member_user'), '用户总数', modstart_admin_url('member'), ColorUtil::randomColor())); $q0jG3->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', $H0Utq['yesterdayCount'], '昨日增长', modstart_admin_url('member'), ColorUtil::randomColor())); $q0jG3->column(4, DashboardItemA::makeIconNumberTitle('iconfont icon-user', $H0Utq['lastWeekCount'], '上周增长', modstart_admin_url('member'), ColorUtil::randomColor())); }); goto G3GLw; djeI5: } }