<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\TreeUtil; class FilterUtil { private static function categoryGet($ZVANG, $M3rBS) { foreach ($ZVANG as $midJh) { if ($midJh['id'] == $M3rBS) { return $midJh; } } return null; } public static function categoryTreeFilter($Rfywh, $ZVANG, $qmVTa = 'title', $OPm8e = 'pid') { goto ytpgc; ymxmn: return array($midJh, $eixaY, $ReR38, $MxCAV, $LDUKQ); goto j_NYp; vo1fW: $LDUKQ = array(); goto xZMyC; zqM2U: $eixaY = array_merge($eixaY, $wON1Q); goto CWQnx; bngk3: $eixaY = array($Rfywh); goto WPdQF; WPdQF: $wON1Q = TreeUtil::nodesChildrenIds($ZVANG, $Rfywh); goto zqM2U; xZMyC: $midJh = null; goto gGDxp; CWQnx: $ReR38 = TreeUtil::nodesChainWithItems($ZVANG, $Rfywh); goto ymxmn; gGDxp: if ($Rfywh) { goto MwIpu; yaPYL: BizException::throwsIfEmpty('分类不存在', $midJh); goto VlCqD; VlCqD: $MxCAV[] = $midJh[$qmVTa]; goto OC_Od; OC_Od: $LDUKQ[] = $midJh[$qmVTa]; goto TDWu_; TDWu_: if ($midJh[$OPm8e]) { $S1gJm = self::categoryGet($ZVANG, $midJh[$OPm8e]); $LDUKQ[] = $S1gJm[$qmVTa]; } goto urDKO; MwIpu: $midJh = self::categoryGet($ZVANG, $Rfywh); goto yaPYL; urDKO: } goto bngk3; ytpgc: $MxCAV = array(); goto vo1fW; j_NYp: } }