<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Widget\Traits; use Illuminate\Support\Facades\DB; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\TimeUtil; trait DSTrait { protected function dsTableCountSeriesDaily($MkLTs, $o6kkl, $Jvdi3 = array()) { goto W6D37; HDthm: return array('time' => array_keys($MlW3d), 'values' => $C1W_f); goto Jo0JD; GMcky: $Kq3sI = strtotime($iWYG8); goto Unv6C; pMwDy: $iWYG8 = $o6kkl . ' 23:59:59'; goto HaeI2; Unv6C: $MlW3d = array(); goto wCLTU; HaeI2: $kcWAV = strtotime($exN2S); goto GMcky; zck19: $jOmeo = array_values($MlW3d); goto kcwow; W6D37: $exN2S = $MkLTs . ' 00:00:00'; goto pMwDy; iTiAG: $C1W_f = array(); goto zck19; wCLTU: for ($G0Ron = $kcWAV; $G0Ron < $Kq3sI; $G0Ron += TimeUtil::PERIOD_DAY) { $V563N = array(); foreach ($Jvdi3 as $QG42Y) { $V563N[] = 0; } $MlW3d[date('Y-m-d', $G0Ron)] = $V563N; } goto my0Du; my0Du: foreach ($Jvdi3 as $aDVv6 => $QG42Y) { goto T_qXd; T_qXd: if (empty($QG42Y['where'])) { $QG42Y['where'] = array(); } goto MlUjZ; MlUjZ: $IaeCl = ModelUtil::model($QG42Y['table'])->where($QG42Y['where'])->where('created_at', '>=', $exN2S)->where('created_at', '<', $iWYG8)->groupBy('_time')->get(array(DB::raw('DATE_FORMAT(created_at, \'%Y-%m-%d\') _time'), DB::raw('COUNT(1) AS _cnt')))->toArray(); goto UeYLG; UeYLG: foreach ($IaeCl as $V563N) { $MlW3d[$V563N['_time']][$aDVv6] = $V563N['_cnt']; } goto cFjM_; cFjM_: } goto iTiAG; kcwow: foreach ($Jvdi3 as $aDVv6 => $QG42Y) { foreach ($jOmeo as $kwV1L) { $C1W_f[$aDVv6][] = $kwV1L[$aDVv6]; } } goto HDthm; Jo0JD: } protected function dsTableSumSeriesDaily($MkLTs, $o6kkl, $Jvdi3 = array()) { goto BYaQv; MK_RN: $iWYG8 = $o6kkl . ' 23:59:59'; goto t632V; eSLtR: $C1W_f = array(); goto FELU2; nBgg7: $MlW3d = array(); goto vUjIP; yIZKp: foreach ($Jvdi3 as $aDVv6 => $QG42Y) { foreach ($jOmeo as $kwV1L) { $C1W_f[$aDVv6][] = $kwV1L[$aDVv6]; } } goto r6LSX; vUjIP: for ($G0Ron = $kcWAV; $G0Ron < $Kq3sI; $G0Ron += TimeUtil::PERIOD_DAY) { $V563N = array(); foreach ($Jvdi3 as $QG42Y) { $V563N[] = 0; } $MlW3d[date('Y-m-d', $G0Ron)] = $V563N; } goto CvSWt; t632V: $kcWAV = strtotime($exN2S); goto xQX5f; BYaQv: $exN2S = $MkLTs . ' 00:00:00'; goto MK_RN; FELU2: $jOmeo = array_values($MlW3d); goto yIZKp; CvSWt: foreach ($Jvdi3 as $aDVv6 => $QG42Y) { goto MK3PP; gfa1H: $IaeCl = ModelUtil::model($QG42Y['table'])->where($QG42Y['where'])->where('created_at', '>=', $exN2S)->where('created_at', '<', $iWYG8)->groupBy('_time')->get(array(DB::raw('DATE_FORMAT(created_at, \'%Y-%m-%d\') _time'), DB::raw('SUM(' . $QG42Y['field'] . ') AS _total')))->toArray(); goto amu3f; amu3f: foreach ($IaeCl as $V563N) { $MlW3d[$V563N['_time']][$aDVv6] = $V563N['_total']; } goto p5a0K; MK3PP: if (empty($QG42Y['where'])) { $QG42Y['where'] = array(); } goto gfa1H; p5a0K: } goto eSLtR; xQX5f: $Kq3sI = strtotime($iWYG8); goto nBgg7; r6LSX: return array('time' => array_keys($MlW3d), 'values' => $C1W_f); goto joRYG; joRYG: } }