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