<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Grid\Filter; use ModStart\Grid\Filter\Field\Datetime; class Range extends AbstractFilter { public function condition($u0mCd) { if (isset($u0mCd['range']) && ($u0mCd['range']['min'] || $u0mCd['range']['max'])) { goto W5WDb; W5WDb: $cBDsM = $u0mCd['range']; goto EG2bz; sW4Av: if (!isset($cBDsM['max'])) { return $this->buildCondition($this->column, '>=', $cBDsM['min']); } goto DhX9A; DhX9A: $this->query = 'whereBetween'; goto YnGQh; YnGQh: return $this->buildCondition($this->column, array($cBDsM['min'], $cBDsM['max'])); goto dyT5X; EG2bz: if (!isset($cBDsM['min'])) { return $this->buildCondition($this->column, '<=', $cBDsM['max']); } goto sW4Av; dyT5X: } return null; } public function datetime() { $this->field = new Field\Datetime($this); return $this; } public function date() { $this->field = new Field\Date($this); return $this; } public function text() { $this->field = new Field\Text($this); return $this; } public function number() { $this->field = new Field\Number($this); return $this; } }