<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Grid\Filter\Field; use ModStart\Core\Exception\BizException; use ModStart\Core\Type\BaseType; class Cascader extends AbstractFilterField { protected $nodes = array(); protected function setup() { $this->addFluentAttributeVariable('nodes'); } public function nodes($mpKYz = null) { goto EKQL9; VR8pp: $this->nodes = $FT9zA; goto DiYNi; EKQL9: if (null === $mpKYz) { return $this->nodes; } goto DPbAz; DPbAz: if (is_string($mpKYz) && is_subclass_of($mpKYz, BaseType::class)) { goto ZrdKE; rP8u8: foreach ($mpKYz::getList() as $kh68j => $tHq0l) { $FT9zA[] = array('id' => $kh68j, 'pid' => 0, 'title' => $tHq0l, 'sort' => $iGR4E++); } goto rlyc4; vSGuH: $iGR4E = 1; goto rP8u8; ZrdKE: $FT9zA = array(); goto vSGuH; rlyc4: } else { if (is_array($mpKYz)) { $FT9zA = $mpKYz; } else { BizException::throws('Select nodes error'); } } goto VR8pp; DiYNi: } }