<?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 $JcqUq) { goto OqNor; yQlv3: $JcqUq->append(Box::make(new Row(function (Row $AO3Sv) { foreach (PayCenterBiz::all() as $qhsmj) { $s4Wt6 = ModelUtil::model('pay_order')->where('status', PayOrderStatus::PAYED)->where('biz', $qhsmj->name())->sum('feeTotal'); $AO3Sv->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', sprintf('%.2f', $s4Wt6), $qhsmj->title())); } }), '业务汇总')); goto OvX22; OqNor: $JcqUq->append(Box::make(new Row(function (Row $AO3Sv) { $AO3Sv->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', PayOrderUtil::totalByTimeRange(date('Y-m-d 00:00:00'), date('Y-m-d 23:59:59')), '今日交易金额')); $AO3Sv->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)), '昨日交易金额')); $AO3Sv->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', PayOrderUtil::total(), '总交易金额')); $AO3Sv->column(3, DashboardItemA::makeIconNumberTitle('iconfont icon-list-alt', ModelUtil::count('pay_order', array('status' => PayOrderStatus::PAYED)), '统一支付订单数')); }), '概况')); goto Z3JDs; OvX22: return $JcqUq->pageTitle('财务概况'); goto SB5_c; Z3JDs: $JcqUq->append(Box::make(new Row(function (Row $AO3Sv) { foreach (PayType::getList() as $kEhTf => $y2Ltn) { goto RYTgH; uMSXl: $s4Wt6 = ModelUtil::model('pay_order')->where('status', PayOrderStatus::PAYED)->where('payType', $kEhTf)->sum('feeTotal'); goto jMYjf; jMYjf: $AO3Sv->column(3, DashboardItemA::makeIconNumberTitle('fa fa-cny', sprintf('%.2f', $s4Wt6), $y2Ltn)); goto Y4ksv; RYTgH: if (!PayUtil::isPayEnable($kEhTf)) { continue; } goto uMSXl; Y4ksv: } }), '支付渠道')); goto yQlv3; SB5_c: } }