<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Grid\Filter; use ModStart\Core\Util\StrUtil; class Like extends AbstractFilter { private $handle = null; public function condition($AgbcE) { if (isset($AgbcE['like']) && $AgbcE['like'] !== '') { if (!empty($this->handle)) { return call_user_func_array($this->handle, array($AgbcE['like'])); } else { return $this->buildCondition($this->column, 'like', "%{$AgbcE['like']}%"); } } return null; } public function handle(\Closure $H7deD) { $this->handle = $H7deD; } public function wordSplit() { $this->handle = function ($CChUV) { return array(array('where' => array(function ($LBO09) use($CChUV) { $q26cr = StrUtil::wordSplit($CChUV); foreach ($q26cr as $NKf8K) { $LBO09->where($this->column, 'like', '%' . $NKf8K . '%'); } }))); }; } }