<?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 $iXUoW) { goto rucnY; rucnY: $iXUoW->append(Box::make(new Row(function (Row $Kqhka) { $Kqhka->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', PayOrderUtil::totalByTimeRange(date('Y-m-d 00:00:00'), date('Y-m-d 23:59:59')), '今日交易金额')); $Kqhka->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)), '昨日交易金额')); $Kqhka->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', PayOrderUtil::total(), '总交易金额')); $Kqhka->column(3, DashboardItemA::makeIconNumberTitle('iconfont icon-list-alt', ModelUtil::count('pay_order', array('status' => PayOrderStatus::PAYED)), '统一支付订单数')); }), '概况')); goto TPXMr; OAmKX: return $iXUoW->pageTitle('财务概况'); goto YaXRc; TPXMr: $iXUoW->append(Box::make(new Row(function (Row $Kqhka) { foreach (PayType::getList() as $KAKiA => $Iim2u) { goto j37Og; i36Wh: $akleJ = ModelUtil::model('pay_order')->where('status', PayOrderStatus::PAYED)->where('payType', $KAKiA)->sum('feeTotal'); goto LDXEc; j37Og: if (!PayUtil::isPayEnable($KAKiA)) { continue; } goto i36Wh; LDXEc: $Kqhka->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', sprintf('%.2f', $akleJ), $Iim2u)); goto c_N9q; c_N9q: } }), '支付渠道')); goto CYbYE; CYbYE: $iXUoW->append(Box::make(new Row(function (Row $Kqhka) { foreach (PayCenterBiz::all() as $g16tm) { $akleJ = ModelUtil::model('pay_order')->where('status', PayOrderStatus::PAYED)->where('biz', $g16tm->name())->sum('feeTotal'); $Kqhka->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', sprintf('%.2f', $akleJ), $g16tm->title())); } }), '业务汇总')); goto OAmKX; YaXRc: } }