Ignore:
Timestamp:
2012/02/28 22:35:14 (12 years ago)
Author:
Seasoft
Message:

#1669 (変数の初期化漏れ)
#1613 (typo修正・ソース整形・ソースコメントの改善)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Review.php

    r21527 r21563  
    107107                if (!$this->arrErr) { 
    108108                    // 検索条件を取得 
    109                     list($where, $arrval) = $this->lfGetWhere($this->arrForm); 
     109                    list($where, $arrWhereVal) = $this->lfGetWhere($this->arrForm); 
    110110                } 
    111111 
    112112                //CSVダウンロード 
    113113                if ($this->getMode() == 'csv') { 
    114                     $this->lfDoOutputCsv($where, $arrval); 
     114                    $this->lfDoOutputCsv($where, $arrWhereVal); 
    115115                    exit; 
    116116                } 
    117117 
    118118                // 検索条件を取得 
    119                 $this->arrReview = $this->lfGetReview($this->arrForm, $where, $arrval); 
     119                $this->arrReview = $this->lfGetReview($this->arrForm, $where, $arrWhereVal); 
    120120                break; 
    121121            default: 
     
    230230     * 
    231231     * @param string $where WHERE文 
    232      * @param array $arrval WHERE文の判定値 
    233      * @return void 
    234      */ 
    235     function lfDoOutputCsv($where, $arrVal) { 
     232     * @param array $arrWhereVal WHERE文の判定値 
     233     * @return void 
     234     */ 
     235    function lfDoOutputCsv($where, $arrWhereVal) { 
    236236        $objCSV = new SC_Helper_CSV_Ex(); 
    237237        if ($where != '') { 
    238238            $where = 'WHERE ' . $where; 
    239239        } 
    240         $objCSV->sfDownloadCsv('4', $where, $arrVal, '', true); 
     240        $objCSV->sfDownloadCsv('4', $where, $arrWhereVal, '', true); 
    241241    } 
    242242 
     
    250250        //削除されていない商品を検索 
    251251        $where = 'A.del_flg = 0 AND B.del_flg = 0'; 
     252        $arrWhereVal = array(); 
    252253 
    253254        foreach ($arrForm AS $key=>$val) { 
     
    258259                    $val = preg_replace('/ /', '%', $val); 
    259260                    $where.= ' AND reviewer_name LIKE ? '; 
    260                     $arrval[] = "%$val%"; 
     261                    $arrWhereVal[] = "%$val%"; 
    261262                    break; 
    262263 
     
    264265                    $val = preg_replace('/ /', '%', $val); 
    265266                    $where.= ' AND reviewer_url LIKE ? '; 
    266                     $arrval[] = "%$val%"; 
     267                    $arrWhereVal[] = "%$val%"; 
    267268                    break; 
    268269 
     
    270271                    $val = preg_replace('/ /', '%', $val); 
    271272                    $where.= ' AND name LIKE ? '; 
    272                     $arrval[] = "%$val%"; 
     273                    $arrWhereVal[] = "%$val%"; 
    273274                    break; 
    274275 
     
    276277                    $val = preg_replace('/ /', '%', $val); 
    277278                    $where.= ' AND A.product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ?)'; 
    278                     $arrval[] = "%$val%"; 
     279                    $arrWhereVal[] = "%$val%"; 
    279280                    break; 
    280281 
     
    290291                                    $tmp_where .= ' OR sex = ?'; 
    291292                                } 
    292                                 $arrval[] = $element; 
     293                                $arrWhereVal[] = $element; 
    293294                            } 
    294295                        } 
     
    303304                case 'search_recommend_level': 
    304305                    $where.= ' AND recommend_level = ? '; 
    305                     $arrval[] = $val; 
     306                    $arrWhereVal[] = $val; 
    306307                    break; 
    307308 
     
    310311                        $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']); 
    311312                        $where.= ' AND A.create_date >= ? '; 
    312                         $arrval[] = $date; 
     313                        $arrWhereVal[] = $date; 
    313314                    } 
    314315                    break; 
     
    327328 
    328329        } 
    329         return array($where, $arrval); 
     330        return array($where, $arrWhereVal); 
    330331    } 
    331332 
     
    335336     * @param array $arrForm フォームデータ 
    336337     * @param string $where WHERE文 
    337      * @param array $arrval WHERE文の判定値 
     338     * @param array $arrWhereVal WHERE文の判定値 
    338339     * @return array レビュー一覧 
    339340     */ 
    340     function lfGetReview($arrForm, $where, $arrval) { 
     341    function lfGetReview($arrForm, $where, $arrWhereVal) { 
    341342        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    342343 
     
    344345        $page_max = SC_Utils_Ex::sfGetSearchPageMax($arrForm['search_page_max']); 
    345346 
    346         if (!isset($arrval)) $arrval = array(); 
     347        if (!isset($arrWhereVal)) $arrWhereVal = array(); 
    347348 
    348349        $from = 'dtb_review AS A LEFT JOIN dtb_products AS B ON A.product_id = B.product_id '; 
    349         $linemax = $objQuery->count($from, $where, $arrval); 
     350        $linemax = $objQuery->count($from, $where, $arrWhereVal); 
    350351        $this->tpl_linemax = $linemax; 
    351352 
     
    369370        $col .= 'reviewer_url, title, comment, A.status, A.create_date, A.update_date, name'; 
    370371        $from = 'dtb_review AS A LEFT JOIN dtb_products AS B ON A.product_id = B.product_id '; 
    371         $arrReview = $objQuery->select($col, $from, $where, $arrval); 
     372        $arrReview = $objQuery->select($col, $from, $where, $arrWhereVal); 
    372373 
    373374        return $arrReview; 
Note: See TracChangeset for help on using the changeset viewer.