<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Grid\Filter; class Between extends AbstractFilter { protected $view = null; public function formatId($xiZoD) { $jkTHm = str_replace('.', '_', $xiZoD); return array('start' => "{$jkTHm}_start", 'end' => "{$jkTHm}_end"); } protected function formatName($xiZoD) { goto n_Q4b; n_Q4b: $tIV0x = explode('.', $xiZoD); goto YKCXt; YKCXt: if (count($tIV0x) == 1) { $XggBq = $tIV0x[0]; } else { $XggBq = array_shift($tIV0x); foreach ($tIV0x as $xiZoD) { $XggBq .= "[{$xiZoD}]"; } } goto RhVzs; RhVzs: return array('start' => "{$XggBq}[start]", 'end' => "{$XggBq}[end]"); goto wFi_S; wFi_S: } public function datetime($atZJ8 = array()) { $this->view = 'admin::filter.betweenDatetime'; $this->prepareForDatetime($atZJ8); } protected function prepareForDatetime($atZJ8 = array()) { goto LCF3E; ClAu0: $atZJ8['locale'] = array_get($atZJ8, 'locale', config('app.locale')); goto krRvh; krRvh: $hVfE0 = json_encode($atZJ8); goto Tf8Aj; LCF3E: $atZJ8['format'] = array_get($atZJ8, 'format', 'YYYY-MM-DD HH:mm:ss'); goto ClAu0; Tf8Aj: $AoXIG = json_encode($atZJ8 + array('useCurrent' => false)); goto IEjcQ; IEjcQ: } public function render() { if (isset($this->view)) { return view($this->view, $this->variables()); } return parent::render(); } }