<?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($E3ils, $s3Bxz, $LimKa = array()) { goto Rbprg; ov6Sq: $lBuoT = array_values($c38Rt); goto cC5Ib; cC5Ib: foreach ($LimKa as $R80S9 => $uYC0g) { foreach ($lBuoT as $YXov8) { $j1IKW[$R80S9][] = $YXov8[$R80S9]; } } goto YZlwl; YZlwl: return array('time' => array_keys($c38Rt), 'values' => $j1IKW); goto hvs2F; bisfQ: $WS5VV = $s3Bxz . ' 23:59:59'; goto SOKvR; SOKvR: $wWDME = strtotime($h5xuX); goto G0h6E; G0h6E: $lTrDO = strtotime($WS5VV); goto DzMe_; XQFXd: foreach ($LimKa as $R80S9 => $uYC0g) { goto lDfsm; Gw8ee: foreach ($OTBPk as $nsWl0) { $c38Rt[$nsWl0['_time']][$R80S9] = $nsWl0['_cnt']; } goto wpEui; lDfsm: if (empty($uYC0g['where'])) { $uYC0g['where'] = array(); } goto hBJ0V; hBJ0V: $OTBPk = ModelUtil::model($uYC0g['table'])->where($uYC0g['where'])->where('created_at', '>=', $h5xuX)->where('created_at', '<', $WS5VV)->groupBy('_time')->get(array(DB::raw('DATE_FORMAT(created_at, \'%Y-%m-%d\') _time'), DB::raw('COUNT(1) AS _cnt')))->toArray(); goto Gw8ee; wpEui: } goto UXQ9Q; Rbprg: $h5xuX = $E3ils . ' 00:00:00'; goto bisfQ; UXQ9Q: $j1IKW = array(); goto ov6Sq; UIv2Z: for ($RoVl5 = $wWDME; $RoVl5 < $lTrDO; $RoVl5 += TimeUtil::PERIOD_DAY) { $nsWl0 = array(); foreach ($LimKa as $uYC0g) { $nsWl0[] = 0; } $c38Rt[date('Y-m-d', $RoVl5)] = $nsWl0; } goto XQFXd; DzMe_: $c38Rt = array(); goto UIv2Z; hvs2F: } protected function dsTableSumSeriesDaily($E3ils, $s3Bxz, $LimKa = array()) { goto yf2x_; O3FQd: $lTrDO = strtotime($WS5VV); goto Dwugh; Dwugh: $c38Rt = array(); goto ONlFM; HHHZn: $WS5VV = $s3Bxz . ' 23:59:59'; goto UO9GC; wC6qe: foreach ($LimKa as $R80S9 => $uYC0g) { goto BQPgA; MfvEN: foreach ($OTBPk as $nsWl0) { $c38Rt[$nsWl0['_time']][$R80S9] = $nsWl0['_total']; } goto uo7dY; BQPgA: if (empty($uYC0g['where'])) { $uYC0g['where'] = array(); } goto igngY; igngY: $OTBPk = ModelUtil::model($uYC0g['table'])->where($uYC0g['where'])->where('created_at', '>=', $h5xuX)->where('created_at', '<', $WS5VV)->groupBy('_time')->get(array(DB::raw('DATE_FORMAT(created_at, \'%Y-%m-%d\') _time'), DB::raw('SUM(' . $uYC0g['field'] . ') AS _total')))->toArray(); goto MfvEN; uo7dY: } goto EN42_; bkeEU: foreach ($LimKa as $R80S9 => $uYC0g) { foreach ($lBuoT as $YXov8) { $j1IKW[$R80S9][] = $YXov8[$R80S9]; } } goto Gcqqq; Gcqqq: return array('time' => array_keys($c38Rt), 'values' => $j1IKW); goto DMEPA; UO9GC: $wWDME = strtotime($h5xuX); goto O3FQd; ONlFM: for ($RoVl5 = $wWDME; $RoVl5 < $lTrDO; $RoVl5 += TimeUtil::PERIOD_DAY) { $nsWl0 = array(); foreach ($LimKa as $uYC0g) { $nsWl0[] = 0; } $c38Rt[date('Y-m-d', $RoVl5)] = $nsWl0; } goto wC6qe; o9yPJ: $lBuoT = array_values($c38Rt); goto bkeEU; EN42_: $j1IKW = array(); goto o9yPJ; yf2x_: $h5xuX = $E3ils . ' 00:00:00'; goto HHHZn; DMEPA: } }