<?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($Ho5Xg) { goto lEZh2; SHvfA: $this->field->options($Ho5Xg); goto YNJom; YNJom: return $this; goto t8OC1; lEZh2: $this->field = new Field\Cascader($this); goto SHvfA; t8OC1: } public function select($Ho5Xg) { goto c79nt; yncer: $this->field->options($Ho5Xg); goto RaljE; c79nt: $this->field = new Field\Select($this); goto yncer; RaljE: return $this; goto JK5qK; JK5qK: } public function selectArray($Ho5Xg, $dH2vW = 'id', $dqafu = 'title') { $Ho5Xg = array_build($Ho5Xg, function ($lxIPA, $knQyJ) use($dH2vW, $dqafu) { return array($knQyJ[$dH2vW], $knQyJ[$dqafu]); }); return $this->select($Ho5Xg); } public function selectModel($loNjC, $WoS8y = 'id', $tYSg7 = 'name', $s1Lo4 = array()) { return $this->select(ModelUtil::valueMap($loNjC, $WoS8y, $tYSg7, $s1Lo4)); } public function selectLevelItems($l3jpm, $dH2vW = 'id', $dqafu = 'title', $GF9F8 = 0) { goto H2Q6J; ywGfT: return $this->select($Ho5Xg); goto zsHLB; gVqYZ: $Ho5Xg[0] = L('Root'); goto xAhn1; H2Q6J: $Ho5Xg = array(); goto gVqYZ; xAhn1: foreach ($l3jpm as $jqibn => $P1uVJ) { if ($GF9F8 > 0) { if ($P1uVJ->_level > $GF9F8 - 1) { continue; } } $Ho5Xg[$P1uVJ->{$dH2vW}] = TreeUtil::itemLevelPrefix($P1uVJ->_level) . $P1uVJ->{$dqafu}; } goto ywGfT; zsHLB: } public function selectModelTree($loNjC, $dH2vW = 'id', $FfN9V = 'pid', $dqafu = 'title', $s3LKR = 'sort', $s1Lo4 = array()) { goto AeXXQ; sTnH3: return $this->selectLevelItems($l3jpm, $dH2vW, $dqafu); goto v8AN8; JKgbO: $l3jpm = TreeUtil::itemsMergeLevel($l3jpm, $dH2vW, $FfN9V, $s3LKR); goto sTnH3; AeXXQ: $l3jpm = ModelUtil::autoModel($loNjC)->where($s1Lo4)->get(array($dH2vW, $FfN9V, $dqafu, $s3LKR)); goto JKgbO; v8AN8: } public function radio($Ho5Xg) { goto XkkaV; XkkaV: $this->field = new Field\Radio($this); goto qhG8N; zUY4O: return $this; goto JOGH0; qhG8N: $this->field->options($Ho5Xg); goto zUY4O; JOGH0: } public function switchRadioYesNo() { goto Ibfg0; Ibfg0: $this->field = new Field\Radio($this); goto xNhR4; xNhR4: $this->field->options(array('0' => L('No'), '1' => L('Yes'))); goto kk1hV; kk1hV: return $this; goto Da6xo; Da6xo: } public function switchRadioOnOff() { goto TxyS7; ieoN4: $this->field->options(array('0' => L('Off'), '1' => L('On'))); goto qteD9; qteD9: return $this; goto vOdbq; TxyS7: $this->field = new Field\Radio($this); goto ieoN4; vOdbq: } public function switchSelectYesNo() { goto wzPcM; Vc3ve: $this->field->options(array('0' => L('No'), '1' => L('Yes'))); goto HRJDf; wzPcM: $this->field = new Field\Select($this); goto Vc3ve; HRJDf: return $this; goto yP5V8; yP5V8: } public function switchSelectOnOff() { goto gGqZk; cyPvR: return $this; goto mrs05; gGqZk: $this->field = new Field\Select($this); goto H7yoZ; H7yoZ: $this->field->options(array('0' => L('Off'), '1' => L('On'))); goto cyPvR; mrs05: } }