Пример #1
0
$searchcats = getsearchcats($categorylist, $catid);
$tagid[] = $catid;
if (is_array($searchcats)) {
    foreach ($searchcats as $key => $value) {
        $tagid[] = $value['catid'];
    }
}
$tagids = implode(',', $tagid);
//搜索分類id拼合
//屬性篩選器
$attrvalues = empty($_GET['params']) ? array() : getattrvalues($_GET['params']);
if ($catid && $categorylist[$catid]['havechild'] == 0) {
    $attform = formatattrs($catid, $attrvalues, $_GET['keyword']);
}
//屬性搜索
$attr_in = getattr_in($catid, $attrvalues);
//條件拼合
$attr_in !== NULL && ($where[] = $attr_in);
$where[] = 'i.grade_s>2 AND i.grade>2';
$_GET['keyword'] && ($where[] = 'i.subject LIKE \'%' . $_GET['keyword'] . '%\'');
if ($catid > 0 && $tagids) {
    $where[] = 'i.catid IN (' . $tagids . ')';
} else {
    $where[] = 'i.catid>0';
}
$wheresql = implode(' AND ', $where);
//分頁處理
$tpp = $_G['setting']['goodsearchperpage'];
//查詢分類結果
if (!($catid && $categorylist[$catid]['havechild'] == 0)) {
    $_BCACHE->cachesql('catnums', 'SELECT COUNT(i.itemid) as count, i.catid FROM ' . tname('gooditems') . ' i WHERE ' . $wheresql . ' GROUP BY i.catid', 0, 0, 100, 0, 'sitelist', 'good');
Пример #2
0
include_once './batch.attribute.php';
$searchcats = getsearchcats($categorylist, $catid);
$tagid[] = $catid;
if (is_array($searchcats)) {
    foreach ($searchcats as $key => $value) {
        $tagid[] = $value['catid'];
    }
}
$tagids = implode(",", $tagid);
//屬性篩選器
$attrvalues = empty($_GET['params']) ? array() : getattrvalues($_GET['params']);
if ($catid && $categorylist[$catid]['havechild'] == 0) {
    $attform = formatattrs($catid, $attrvalues, $_GET['keyword'], 'album.php');
}
//屬性搜索
$attr_in = getattr_in($attrvalues);
//條件拼合
$attr_in !== NULL && ($where[] = $attr_in);
$where[] = 'i.grade_s>2 AND i.grade>2';
$_GET['keyword'] && ($where[] = 'i.subject LIKE \'%' . $_GET['keyword'] . '%\'');
if ($catid > 0 && $tagids) {
    $where[] = 'i.catid IN (' . $tagids . ')';
} else {
    $where[] = 'i.catid>0';
}
$wheresql = implode(' AND ', $where);
//分頁處理
$tpp = $_G['setting']['albumsearchperpage'];
//查詢分類結果
if (!($catid && $categorylist[$catid]['havechild'] == 0)) {
    $_BCACHE->cachesql('catnums', 'SELECT COUNT(i.itemid) as count, i.catid FROM ' . tname('albumitems') . ' i WHERE ' . $wheresql . ' GROUP BY i.catid', 0, 0, 100, 0, 'sitelist', 'album');