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