/** * Блок "filters" */ namespace itlife\catalog; use itlife\files\Xlsx; $ans = array(); $md = Catalog::initMark($ans); $conf = infra_config(); $args = array(Catalog::nocache($md)); $res = Catalog::cache('filters.php filter list', function ($md) { $conf = infra_config(); $ans = array(); $params = Catalog::getParams($md['group']); $poss = Catalog::getPoss($md['group']); //Поиск $count = sizeof($poss); //Позиций в группе $res = Catalog::search($md); $poss = $res['list']; $search = sizeof($poss); //Позиций найдено //ПОСЧИТАЛИ FILTER со всеми md foreach ($params as $k => $prop) { if ($prop['more']) { foreach ($poss as &$pos) { if (!Xlsx::isSpecified($pos['more'][$prop['posid']])) { continue; } $r = false;
public static function search($md, &$ans = array()) { $args = array(Catalog::nocache($md)); $res = Catalog::cache('search.php filter list', function ($md) { $conf = infra_config(); $ans['list'] = Catalog::getPoss($md['group']); //ЭТАП filters list $ans['filters'] = Catalog::filtering($ans['list'], $md); foreach ($md['group'] as $now => $one) { break; } $ans['childs'] = Catalog::getGroups($ans['list'], $now); $ans['count'] = sizeof($ans['list']); return $ans; }, $args, isset($_GET['re'])); $ans = array_merge($ans, $res); return $ans; }