Changeset 16919


Ignore:
Timestamp:
2007/12/14 16:57:42 (16 years ago)
Author:
satou
Message:

#195
修正しました。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php

    r16741 r16919  
    8484                switch ($key) { 
    8585                case 'search_name': 
    86  
    8786                    $where .= " AND name ILIKE ?"; 
    8887                    $arrval[] = "%$val%"; 
    8988                    break; 
    9089                case 'search_category_id': 
    91                     // 子カテゴリIDの取得 
    92                     $arrRet = $objDb->sfGetChildsID("dtb_category", "parent_category_id", "category_id", $val); 
    93                     $tmp_where = ""; 
    94                     foreach ($arrRet as $val) { 
    95                         if($tmp_where == "") { 
    96                             $tmp_where.= " AND ( category_id = ?"; 
    97                         } else { 
    98                             $tmp_where.= " OR category_id = ?"; 
    99                         } 
    100                         $arrval[] = $val; 
     90                     list($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere($val); 
     91                    if($tmp_where != "") { 
     92                        $where.= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")"; 
     93                        $arrval = array_merge((array)$arrval, (array)$tmp_arrval); 
    10194                    } 
    102                     $where.= $tmp_where . " )"; 
    10395                    break; 
    10496                case 'search_product_code': 
    105                     $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)"; 
    106                     $where .= " OR product_code ILIKE ?"; 
    107                     $arrval[] = "%$val%"; 
    108                     $arrval[] = "%$val%"; 
     97                    $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ? GROUP BY product_id)"; 
     98                    $arrval[] = "$val%"; 
    10999                    break; 
    110100                default: 
Note: See TracChangeset for help on using the changeset viewer.