<?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($atZJ8) { goto DCFGC; r2B1a: $this->field->options($atZJ8); goto ARFmb; DCFGC: $this->field = new Field\Cascader($this); goto r2B1a; ARFmb: return $this; goto P9bqQ; P9bqQ: } public function select($atZJ8) { goto NPdBB; ZvJ5P: $this->field->options($atZJ8); goto PWlvj; NPdBB: $this->field = new Field\Select($this); goto ZvJ5P; PWlvj: return $this; goto h0vhn; h0vhn: } public function selectArray($atZJ8, $u3aKG = 'id', $RwQHi = 'title') { $atZJ8 = array_build($atZJ8, function ($F_a6B, $JiRHR) use($u3aKG, $RwQHi) { return array($JiRHR[$u3aKG], $JiRHR[$RwQHi]); }); return $this->select($atZJ8); } public function selectModel($Y2RbY, $MQulf = 'id', $nbb6p = 'name', $hAsFN = array()) { return $this->select(ModelUtil::valueMap($Y2RbY, $MQulf, $nbb6p, $hAsFN)); } public function selectLevelItems($FF843, $u3aKG = 'id', $RwQHi = 'title', $q7MtH = 0) { goto cpk_b; Lp3r7: foreach ($FF843 as $JhHfm => $V563N) { if ($q7MtH > 0) { if ($V563N->_level > $q7MtH - 1) { continue; } } $atZJ8[$V563N->{$u3aKG}] = TreeUtil::itemLevelPrefix($V563N->_level) . $V563N->{$RwQHi}; } goto iP4oq; cpk_b: $atZJ8 = array(); goto CdDFs; CdDFs: $atZJ8[0] = L('Root'); goto Lp3r7; iP4oq: return $this->select($atZJ8); goto FyurO; FyurO: } public function selectModelTree($Y2RbY, $u3aKG = 'id', $BnYoa = 'pid', $RwQHi = 'title', $BYNn7 = 'sort', $hAsFN = array()) { goto cW1Oi; Vdfn2: $FF843 = TreeUtil::itemsMergeLevel($FF843, $u3aKG, $BnYoa, $BYNn7); goto Sxw_T; Sxw_T: return $this->selectLevelItems($FF843, $u3aKG, $RwQHi); goto NfIdj; cW1Oi: $FF843 = ModelUtil::autoModel($Y2RbY)->where($hAsFN)->get(array($u3aKG, $BnYoa, $RwQHi, $BYNn7)); goto Vdfn2; NfIdj: } public function radio($atZJ8) { goto lHZu1; Hk6tM: return $this; goto e52WT; lHZu1: $this->field = new Field\Radio($this); goto uj8D5; uj8D5: $this->field->options($atZJ8); goto Hk6tM; e52WT: } public function switchRadioYesNo() { goto amAPC; ROjp7: return $this; goto i0N2V; ey05z: $this->field->options(array('0' => L('No'), '1' => L('Yes'))); goto ROjp7; amAPC: $this->field = new Field\Radio($this); goto ey05z; i0N2V: } public function switchRadioOnOff() { goto KqLOJ; VGNRX: $this->field->options(array('0' => L('Off'), '1' => L('On'))); goto ieHKO; KqLOJ: $this->field = new Field\Radio($this); goto VGNRX; ieHKO: return $this; goto IhsV1; IhsV1: } public function switchSelectYesNo() { goto wwcUq; K3v9_: $this->field->options(array('0' => L('No'), '1' => L('Yes'))); goto pESVk; wwcUq: $this->field = new Field\Select($this); goto K3v9_; pESVk: return $this; goto yFvtZ; yFvtZ: } public function switchSelectOnOff() { goto IG6Jq; a1ZOQ: return $this; goto Ln_Md; IG6Jq: $this->field = new Field\Select($this); goto DUN5h; DUN5h: $this->field->options(array('0' => L('Off'), '1' => L('On'))); goto a1ZOQ; Ln_Md: } }