<?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($JnEKk) { if (isset($JnEKk['has']) && is_array($JnEKk['has'])) { return $this->buildCondition($this->column, $JnEKk['has']); } return null; } public function checkbox($nO0o6) { goto fI4i_; fI4i_: $this->field = new Field\Checkbox($this); goto l045A; l045A: $this->field->options($nO0o6); goto hefWM; hefWM: return $this; goto sGrSE; sGrSE: } public function cascader($nO0o6) { goto RoXOG; gd9i8: return $this; goto B2NX9; RoXOG: $this->field = new Field\Cascader($this); goto Jyi4Z; Jyi4Z: $this->field->nodes($nO0o6); goto gd9i8; B2NX9: } public function cascaderModel($wt8xl, $nKw5n = 'id', $QyP0C = 'pid', $zBo0E = 'title', $w78MX = 'sort') { goto nK0st; eGLY7: foreach (ModelUtil::all($wt8xl, array(), array($nKw5n, $QyP0C, $zBo0E, $w78MX), array($w78MX, 'asc')) as $Xvngd) { $bs3PA[] = array('id' => $Xvngd[$nKw5n], 'title' => $Xvngd[$zBo0E], 'pid' => $Xvngd[$QyP0C], 'sort' => $Xvngd[$w78MX]); } goto A2RxA; A2RxA: return $this->cascader($bs3PA); goto nqlb2; nK0st: $bs3PA = array(); goto eGLY7; nqlb2: } }