<?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 $JcqUq) { goto omTEm; icRDe: $gwmIt->canAdd(false)->disableItemOperate(); goto dxvu1; j512d: $gwmIt->gridBeforeRequestScriptView('module::PayCenter.View.admin.report.beforeScript'); goto mtenZ; OlFhP: $gwmIt->text('body', '内容'); goto giw5v; fCLs2: $gwmIt->gridTableTopView('module::PayCenter.View.admin.report.panel'); goto icRDe; CI32I: $gwmIt->repositoryFilter(function (RepositoryFilter $bu01d) { $bu01d->where('status', PayOrderStatus::PAYED); }); goto oHgp6; omTEm: $gwmIt = Grid::make('pay_order'); goto WRe11; oHgp6: $gwmIt->gridFilter(function (GridFilter $bu01d) { $bu01d->eq('id', '结算ID'); $UHxiu = date('Y-m-d 00:00:00', time() - TimeUtil::PERIOD_MONTH); $SjdXg = date('Y-m-d 23:59:59', time()); $bu01d->range('created_at', '时间')->datetime()->defaultValue(array('min' => $UHxiu, 'max' => $SjdXg))->field()->quickSelect(); $bu01d->has('payType', '类型')->checkbox(PayType::class)->autoHide(true); }); goto j512d; Lh1bS: $gwmIt->display('created_at', '时间'); goto Ue2W7; FHE_3: $gwmIt->type('payType', '支付类型')->type(PayType::class); goto wFnjQ; dxvu1: return $JcqUq->pageTitle('订单对账')->body($gwmIt)->handleGrid($gwmIt); goto M2QwH; yuuxl: $gwmIt->type('status', '状态')->type(PayOrderStatus::class); goto FHE_3; giw5v: $gwmIt->display('updated_at', L('Updated At'))->listable(false); goto CI32I; WRe11: $gwmIt->id('id', '结算ID'); goto Lh1bS; Ue2W7: $gwmIt->select('biz', '业务')->options(PayCenterBiz::allMap()); goto xWxm2; xWxm2: $gwmIt->text('bizId', '业务订单ID'); goto yuuxl; wFnjQ: $gwmIt->currency('feeTotal', '金额'); goto OlFhP; mtenZ: $gwmIt->gridRequestScript(function (Grid $gwmIt) { $WZ8dY = InputPackage::buildFromInput(); $L70ct = null; $pLF6z = null; foreach ($WZ8dY->getArray('search') as $BLmcz) { if (empty($BLmcz)) { continue; } foreach ($BLmcz as $kEhTf => $y2Ltn) { if ($kEhTf == 'created_at') { goto SIU46; SIU46: $L70ct = $y2Ltn['range']['min']; goto t6bSU; t6bSU: $pLF6z = $y2Ltn['range']['max']; goto jvgfv; jvgfv: break; goto V5Yef; V5Yef: } } } $iO1JY = ReportUtil::option($gwmIt->executeQuery(), $L70ct, $pLF6z); return RenderUtil::viewScript('module::PayCenter.View.admin.report.script', array('total' => sprintf('%.2f', $gwmIt->executeQuery()->sum('feeTotal')), 'count' => number_format($gwmIt->executeQuery()->count()), 'chartOption' => $iO1JY)); }); goto fCLs2; M2QwH: } }