<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PayCenter\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\TimeUtil; use ModStart\Layout\Row; use ModStart\Widget\Box; use Module\PayCenter\Biz\PayCenterBiz; use Module\PayCenter\Type\PayOrderStatus; use Module\PayCenter\Type\PayType; use Module\PayCenter\Util\PayOrderUtil; use Module\PayCenter\Util\PayUtil; class DashboardController extends Controller { public function index(AdminPage $evgNV) { goto W6cyh; W6cyh: $evgNV->append(Box::make(new Row(function (Row $prd0q) { $prd0q->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', PayOrderUtil::totalByTimeRange(date('Y-m-d 00:00:00'), date('Y-m-d 23:59:59')), '今日交易金额')); $prd0q->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', PayOrderUtil::totalByTimeRange(date('Y-m-d 00:00:00', time() - TimeUtil::PERIOD_DAY), date('Y-m-d 23:59:59', time() - TimeUtil::PERIOD_DAY)), '昨日交易金额')); $prd0q->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', PayOrderUtil::total(), '总交易金额')); $prd0q->column(3, DashboardItemA::makeIconNumberTitle('iconfont icon-list-alt', ModelUtil::count('pay_order', array('status' => PayOrderStatus::PAYED)), '统一支付订单数')); }), '概况')); goto ADLwU; ADLwU: $evgNV->append(Box::make(new Row(function (Row $prd0q) { foreach (PayType::getList() as $JdFJR => $PSYn9) { goto mLuAU; mLuAU: if (!PayUtil::isPayEnable($JdFJR)) { continue; } goto dPCp6; dPCp6: $LGs0v = ModelUtil::model('pay_order')->where('status', PayOrderStatus::PAYED)->where('payType', $JdFJR)->sum('feeTotal'); goto oVC0J; oVC0J: $prd0q->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', sprintf('%.2f', $LGs0v), $PSYn9)); goto P3lIQ; P3lIQ: } }), '支付渠道')); goto Fgwim; Sdstk: return $evgNV->pageTitle('财务概况'); goto jISsd; Fgwim: $evgNV->append(Box::make(new Row(function (Row $prd0q) { foreach (PayCenterBiz::all() as $Dnlri) { $LGs0v = ModelUtil::model('pay_order')->where('status', PayOrderStatus::PAYED)->where('biz', $Dnlri->name())->sum('feeTotal'); $prd0q->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', sprintf('%.2f', $LGs0v), $Dnlri->title())); } }), '业务汇总')); goto Sdstk; jISsd: } }