<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\TreeUtil; class FilterUtil { private static function categoryGet($FLByG, $pNLgg) { foreach ($FLByG as $Q4JCn) { if ($Q4JCn['id'] == $pNLgg) { return $Q4JCn; } } return null; } public static function categoryTreeFilter($pEnmx, $FLByG, $TOdi3 = 'title', $MaCDN = 'pid') { goto Itdxp; VAnEo: $cZO19 = TreeUtil::nodesChildrenIds($FLByG, $pEnmx); goto kzjO0; kJ3Jz: if ($pEnmx) { goto kzOmR; kzOmR: $Q4JCn = self::categoryGet($FLByG, $pEnmx); goto ZEso8; ZEso8: BizException::throwsIfEmpty('分类不存在', $Q4JCn); goto fa1DB; fa1DB: $dap0h[] = $Q4JCn[$TOdi3]; goto AVu7K; AVu7K: $vB4op[] = $Q4JCn[$TOdi3]; goto sqb2R; sqb2R: if ($Q4JCn[$MaCDN]) { $MozU7 = self::categoryGet($FLByG, $Q4JCn[$MaCDN]); $vB4op[] = $MozU7[$TOdi3]; } goto uAbRs; uAbRs: } goto grLjd; lGMnN: $vB4op = array(); goto Ww9DS; Ww9DS: $Q4JCn = null; goto kJ3Jz; Itdxp: $dap0h = array(); goto lGMnN; rNdjI: $Q46nR = TreeUtil::nodesChainWithItems($FLByG, $pEnmx); goto Cr3q0; grLjd: $zMKLR = array($pEnmx); goto VAnEo; Cr3q0: return array($Q4JCn, $zMKLR, $Q46nR, $dap0h, $vB4op); goto Yecs4; kzjO0: $zMKLR = array_merge($zMKLR, $cZO19); goto rNdjI; Yecs4: } }