示例#1
0
$categorylist = getmodelcategory('good');
//讀商品分類
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);
//搜索分類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'];
示例#2
0
$_GET['keyword'] = trim(addslashes(rawurldecode($_REQUEST['keyword'])));
$catid = empty($_GET['catid']) ? 0 : $_GET['catid'];
$categorylist = getmodelcategory('album');
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'];