<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Grid\Filter; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\TreeUtil; class Eq extends AbstractFilter { public function cascader($nO0o6) { goto yRDf6; vzLxm: $this->field->options($nO0o6); goto FbPyQ; yRDf6: $this->field = new Field\Cascader($this); goto vzLxm; FbPyQ: return $this; goto m2frz; m2frz: } public function select($nO0o6) { goto wfX1o; lJH0S: $this->field->options($nO0o6); goto a_5rh; a_5rh: return $this; goto rg5Z_; wfX1o: $this->field = new Field\Select($this); goto lJH0S; rg5Z_: } public function selectArray($nO0o6, $aHfow = 'id', $mgO1O = 'title') { $nO0o6 = array_build($nO0o6, function ($RTHJ6, $F6Fus) use($aHfow, $mgO1O) { return array($F6Fus[$aHfow], $F6Fus[$mgO1O]); }); return $this->select($nO0o6); } public function selectModel($wt8xl, $AWXu8 = 'id', $mfJsz = 'name', $uxPm_ = array()) { return $this->select(ModelUtil::valueMap($wt8xl, $AWXu8, $mfJsz, $uxPm_)); } public function selectLevelItems($GCp0X, $aHfow = 'id', $mgO1O = 'title', $KWM89 = 0) { goto b3TAP; UAJU2: $nO0o6[0] = L('Root'); goto VYJKy; VYJKy: foreach ($GCp0X as $MqJHJ => $Xvngd) { if ($KWM89 > 0) { if ($Xvngd->_level > $KWM89 - 1) { continue; } } $nO0o6[$Xvngd->{$aHfow}] = TreeUtil::itemLevelPrefix($Xvngd->_level) . $Xvngd->{$mgO1O}; } goto THvx0; THvx0: return $this->select($nO0o6); goto ykqJ8; b3TAP: $nO0o6 = array(); goto UAJU2; ykqJ8: } public function selectModelTree($wt8xl, $aHfow = 'id', $FWABY = 'pid', $mgO1O = 'title', $KpDOG = 'sort', $uxPm_ = array()) { goto n5HXx; FeFxM: $GCp0X = TreeUtil::itemsMergeLevel($GCp0X, $aHfow, $FWABY, $KpDOG); goto IUEpe; IUEpe: return $this->selectLevelItems($GCp0X, $aHfow, $mgO1O); goto uo7it; n5HXx: $GCp0X = ModelUtil::autoModel($wt8xl)->where($uxPm_)->get(array($aHfow, $FWABY, $mgO1O, $KpDOG)); goto FeFxM; uo7it: } public function radio($nO0o6) { goto I5esZ; I5esZ: $this->field = new Field\Radio($this); goto URnO3; URnO3: $this->field->options($nO0o6); goto oRn5v; oRn5v: return $this; goto kAvI0; kAvI0: } public function switchRadioYesNo() { goto f7YbB; X4JP4: $this->field->options(array('0' => L('No'), '1' => L('Yes'))); goto lD1H2; f7YbB: $this->field = new Field\Radio($this); goto X4JP4; lD1H2: return $this; goto lHeiq; lHeiq: } public function switchRadioOnOff() { goto jNgFR; jNgFR: $this->field = new Field\Radio($this); goto t1c2s; t1c2s: $this->field->options(array('0' => L('Off'), '1' => L('On'))); goto ksB2b; ksB2b: return $this; goto Z7bLF; Z7bLF: } public function switchSelectYesNo() { goto iSNl7; iSNl7: $this->field = new Field\Select($this); goto dHBMb; XdXdy: return $this; goto dTDWS; dHBMb: $this->field->options(array('0' => L('No'), '1' => L('Yes'))); goto XdXdy; dTDWS: } public function switchSelectOnOff() { goto z8Tvt; AdQlF: return $this; goto fsFIj; kaJbw: $this->field->options(array('0' => L('Off'), '1' => L('On'))); goto AdQlF; z8Tvt: $this->field = new Field\Select($this); goto kaJbw; fsFIj: } }