<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Grid\Filter; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Type\BaseType; class Has extends AbstractFilter { protected $query = 'whereIn'; public function condition($u0mCd) { if (isset($u0mCd['has']) && is_array($u0mCd['has'])) { return $this->buildCondition($this->column, $u0mCd['has']); } return null; } public function checkbox($Ho5Xg) { goto PyjMv; e3WI3: $this->field->options($Ho5Xg); goto AVTYx; AVTYx: return $this; goto g8QRt; PyjMv: $this->field = new Field\Checkbox($this); goto e3WI3; g8QRt: } public function cascader($Ho5Xg) { goto a7INv; BZPvl: $this->field->nodes($Ho5Xg); goto DPZfG; DPZfG: return $this; goto NmDyu; a7INv: $this->field = new Field\Cascader($this); goto BZPvl; NmDyu: } public function cascaderModel($loNjC, $ZXycr = 'id', $NtPRD = 'pid', $ttUzK = 'title', $lmA4q = 'sort') { goto FK6Ya; FK6Ya: $foy7G = array(); goto Fea8z; Fea8z: foreach (ModelUtil::all($loNjC, array(), array($ZXycr, $NtPRD, $ttUzK, $lmA4q), array($lmA4q, 'asc')) as $P1uVJ) { $foy7G[] = array('id' => $P1uVJ[$ZXycr], 'title' => $P1uVJ[$ttUzK], 'pid' => $P1uVJ[$NtPRD], 'sort' => $P1uVJ[$lmA4q]); } goto pT2wZ; pT2wZ: return $this->cascader($foy7G); goto b_Z3F; b_Z3F: } }