<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PayCenter\Admin\Controller; use Illuminate\Routing\Controller; use Illuminate\Support\Facades\DB; use ModStart\Admin\Layout\AdminPage; use ModStart\Core\Input\InputPackage; use ModStart\Core\Util\ColorUtil; use ModStart\Core\Util\RandomUtil; use ModStart\Core\Util\RenderUtil; use ModStart\Core\Util\TimeUtil; use ModStart\Grid\Grid; use ModStart\Grid\GridFilter; use ModStart\Repository\Filter\RepositoryFilter; use ModStart\Widget\Chart\Line; use Module\PayCenter\Biz\PayCenterBiz; use Module\PayCenter\Type\PayOrderStatus; use Module\PayCenter\Type\PayType; use Module\PayCenter\Util\ReportUtil; class ReportController extends Controller { public function index(AdminPage $iXUoW) { goto yYPLK; rOgOJ: $W3CVY->id('id', '结算ID'); goto FjEnM; FjEnM: $W3CVY->display('created_at', '时间'); goto VffQH; VUxW8: $W3CVY->text('bizId', '业务订单ID'); goto q1J9t; lJxPy: $W3CVY->canAdd(false)->disableItemOperate(); goto hxy4b; q1J9t: $W3CVY->type('status', '状态')->type(PayOrderStatus::class); goto pkR_c; vzS1B: $W3CVY->currency('feeTotal', '金额'); goto ILGF8; hxy4b: return $iXUoW->pageTitle('订单对账')->body($W3CVY)->handleGrid($W3CVY); goto nAWT0; rIezj: $W3CVY->gridRequestScript(function (Grid $W3CVY) { $Km8YS = InputPackage::buildFromInput(); $exxst = null; $Fezgp = null; foreach ($Km8YS->getArray('search') as $hsUGN) { if (empty($hsUGN)) { continue; } foreach ($hsUGN as $KAKiA => $Iim2u) { if ($KAKiA == 'created_at') { goto t7DXd; t7DXd: $exxst = $Iim2u['range']['min']; goto GB2cN; GB2cN: $Fezgp = $Iim2u['range']['max']; goto AHB16; AHB16: break; goto WZJVp; WZJVp: } } } $BtwZr = ReportUtil::option($W3CVY->executeQuery(), $exxst, $Fezgp); return RenderUtil::viewScript('module::PayCenter.View.admin.report.script', array('total' => sprintf('%.2f', $W3CVY->executeQuery()->sum('feeTotal')), 'count' => number_format($W3CVY->executeQuery()->count()), 'chartOption' => $BtwZr)); }); goto adAO7; yEgUV: $W3CVY->gridFilter(function (GridFilter $mHisM) { $mHisM->eq('id', '结算ID'); $bidxL = date('Y-m-d 00:00:00', time() - TimeUtil::PERIOD_MONTH); $FcInZ = date('Y-m-d 23:59:59', time()); $mHisM->range('created_at', '时间')->datetime()->defaultValue(array('min' => $bidxL, 'max' => $FcInZ))->field()->quickSelect(); $mHisM->has('payType', '类型')->checkbox(PayType::class)->autoHide(true); }); goto qAx0h; ILGF8: $W3CVY->text('body', '内容'); goto Tfgy_; qAx0h: $W3CVY->gridBeforeRequestScriptView('module::PayCenter.View.admin.report.beforeScript'); goto rIezj; yYPLK: $W3CVY = Grid::make('pay_order'); goto rOgOJ; adAO7: $W3CVY->gridTableTopView('module::PayCenter.View.admin.report.panel'); goto lJxPy; WIqOW: $W3CVY->repositoryFilter(function (RepositoryFilter $mHisM) { $mHisM->where('status', PayOrderStatus::PAYED); }); goto yEgUV; pkR_c: $W3CVY->type('payType', '支付类型')->type(PayType::class); goto vzS1B; Tfgy_: $W3CVY->display('updated_at', L('Updated At'))->listable(false); goto WIqOW; VffQH: $W3CVY->select('biz', '业务')->options(PayCenterBiz::allMap()); goto VUxW8; nAWT0: } }