<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PayCenter\Util; use Illuminate\Support\Facades\DB; use ModStart\Core\Util\TimeUtil; use ModStart\Widget\Chart\Chart; class ReportUtil { public static function option($mwwOg, $L70ct = null, $pLF6z = null) { goto IeGKz; hfmaL: if (null === $pLF6z) { $pLF6z = date('Y-m-d'); } goto W1BFI; nE3wO: $b7Pgo = array_build($U8wjN, function ($kEhTf, $y2Ltn) { return array($y2Ltn['d'], $y2Ltn); }); goto xDdgL; xx4NL: foreach ($vlpoC as $Ao5Ny) { $XG83Q[] = isset($b7Pgo[$Ao5Ny]) ? $b7Pgo[$Ao5Ny]['count'] : 0; $QkOUb[] = isset($b7Pgo[$Ao5Ny]) ? $b7Pgo[$Ao5Ny]['total'] : 0; } goto VRjgS; mDTFP: $QkOUb = array(); goto xx4NL; IeGKz: if (null === $L70ct) { $L70ct = date('Y-m-d', strtotime('-30 days')); } goto hfmaL; W1BFI: $vlpoC = TimeUtil::dateCollection($L70ct, $pLF6z); goto kdtlM; xDdgL: $XG83Q = array(); goto mDTFP; kdtlM: $U8wjN = $mwwOg->groupBy('d')->orderBy('d', 'DESC')->get(array(DB::raw('Date(created_at) as d'), DB::raw('COUNT(*) as count'), DB::raw('SUM(feeTotal) as total')))->toArray(); goto nE3wO; VRjgS: $iO1JY = Chart::make()->optionSet('legend', array('data' => array('交易笔数', '收款金额')))->optionSet('xAxis', array(array('type' => 'category', 'data' => $vlpoC)))->optionSet('yAxis', array(array('type' => 'value', 'name' => '交易笔数'), array('type' => 'value', 'name' => '收款金额')))->optionSet('series', array(array('name' => '交易笔数', 'type' => 'line', 'smooth' => true, 'data' => $XG83Q), array('name' => '收款金额', 'type' => 'bar', 'yAxisIndex' => 1, 'data' => $QkOUb, 'itemStyle' => array('normal' => array('color' => '#4359B9')))))->option(); goto Tp2Am; Tp2Am: return $iO1JY; goto BW8to; BW8to: } }