Ignore:
Timestamp:
2012/02/15 19:56:17 (14 years ago)
Author:
Seasoft
Message:

#1625 (typo修正・ソース整形・ソースコメントの改善)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_CustomerList.php

    r21481 r21514  
    3737        $dbFactory = SC_DB_DBFactory_Ex::getInstance(); 
    3838 
    39         if ($mode == "") { 
     39        if ($mode == '') { 
    4040            // 会員本登録会員で削除していない会員 
    41             $this->setWhere("status = 2 AND del_flg = 0 "); 
     41            $this->setWhere('status = 2 AND del_flg = 0 '); 
    4242            // 登録日を示すカラム 
    4343            $regdate_col = 'dtb_customer.update_date'; 
     
    4545 
    4646        if ($mode == 'customer') { 
    47             $this->setWhere(" del_flg = 0 "); 
     47            $this->setWhere(' del_flg = 0 '); 
    4848            // 登録日を示すカラム 
    4949            $regdate_col = 'dtb_customer.update_date'; 
     
    5353        if (!isset($this->arrSql['search_customer_id'])) $this->arrSql['search_customer_id'] = ""; 
    5454        if (strlen($this->arrSql['search_customer_id']) > 0) { 
    55             $this->setWhere("customer_id =  ?"); 
     55            $this->setWhere('customer_id =  ?'); 
    5656            $this->arrVal[] = $this->arrSql['search_customer_id']; 
    5757        } 
     
    6060        if (!isset($this->arrSql['search_name'])) $this->arrSql['search_name'] = ""; 
    6161        if (strlen($this->arrSql['search_name']) > 0) { 
    62             $this->setWhere("(" . $dbFactory->concatColumn(array('name01', 'name02')) . " LIKE ?)"); 
     62            $this->setWhere('(' . $dbFactory->concatColumn(array('name01', 'name02')) . " LIKE ?)"); 
    6363            $searchName = $this->addSearchStr($this->arrSql['search_name']); 
    64             $this->arrVal[] = mb_ereg_replace("[  ]+","",$searchName); 
     64            $this->arrVal[] = mb_ereg_replace('[  ]+','',$searchName); 
    6565        } 
    6666 
     
    6868        if (!isset($this->arrSql['search_kana'])) $this->arrSql['search_kana'] = ""; 
    6969        if (strlen($this->arrSql['search_kana']) > 0) { 
    70             $this->setWhere("(" . $dbFactory->concatColumn(array('kana01', 'kana02')) . " LIKE ?)"); 
     70            $this->setWhere('(' . $dbFactory->concatColumn(array('kana01', 'kana02')) . " LIKE ?)"); 
    7171            $searchKana = $this->addSearchStr($this->arrSql['search_kana']); 
    72             $this->arrVal[] = mb_ereg_replace("[  ]+","",$searchKana); 
     72            $this->arrVal[] = mb_ereg_replace('[  ]+','',$searchKana); 
    7373        } 
    7474 
     
    7676        if (!isset($this->arrSql['search_pref'])) $this->arrSql['search_pref'] = ""; 
    7777        if (strlen($this->arrSql['search_pref']) > 0) { 
    78             $this->setWhere("pref = ?"); 
     78            $this->setWhere('pref = ?'); 
    7979            $this->arrVal[] = $this->arrSql['search_pref']; 
    8080        } 
     
    8383        if (!isset($this->arrSql['search_tel'])) $this->arrSql['search_tel'] = ""; 
    8484        if (is_numeric($this->arrSql['search_tel'])) { 
    85             $this->setWhere("(" . $dbFactory->concatColumn(array('tel01', 'tel02', 'tel03')) . " LIKE ?)"); 
     85            $this->setWhere('(' . $dbFactory->concatColumn(array('tel01', 'tel02', 'tel03')) . " LIKE ?)"); 
    8686            $searchTel = $this->addSearchStr($this->arrSql['search_tel']); 
    87             $this->arrVal[] = ereg_replace("-", "", $searchTel); 
     87            $this->arrVal[] = ereg_replace('-', '', $searchTel); 
    8888        } 
    8989 
     
    100100        if (!isset($this->arrSql['search_job'])) $this->arrSql['search_job'] = ""; 
    101101        if (is_array($this->arrSql['search_job'])) { 
    102             if (in_array("不明", $this->arrSql['search_job'])) { 
     102            if (in_array('不明', $this->arrSql['search_job'])) { 
    103103                $arrJobVal = $this->setItemTermWithNull($this->arrSql['search_job'] ,'job'); 
    104104            } else { 
     
    116116        if (strlen($this->arrSql['search_email']) > 0) { 
    117117            //カンマ区切りで複数の条件指定可能に 
    118             $this->arrSql['search_email'] = explode(",", $this->arrSql['search_email']); 
    119             $sql_where = ""; 
     118            $this->arrSql['search_email'] = explode(',', $this->arrSql['search_email']); 
     119            $sql_where = ''; 
    120120            foreach ($this->arrSql['search_email'] as $val) { 
    121121                $val = trim($val); 
    122122                //検索条件を含まない 
    123123                if ($this->arrSql['not_emailinc'] == '1') { 
    124                     if ($sql_where == "") { 
    125                         $sql_where .= "dtb_customer.email NOT ILIKE ? "; 
     124                    if ($sql_where == '') { 
     125                        $sql_where .= 'dtb_customer.email NOT ILIKE ? '; 
    126126                    } else { 
    127                         $sql_where .= "AND dtb_customer.email NOT ILIKE ? "; 
     127                        $sql_where .= 'AND dtb_customer.email NOT ILIKE ? '; 
    128128                    } 
    129129                } else { 
    130                     if ($sql_where == "") { 
    131                         $sql_where .= "dtb_customer.email ILIKE ? "; 
     130                    if ($sql_where == '') { 
     131                        $sql_where .= 'dtb_customer.email ILIKE ? '; 
    132132                    } else { 
    133                         $sql_where .= "OR dtb_customer.email ILIKE ? "; 
     133                        $sql_where .= 'OR dtb_customer.email ILIKE ? '; 
    134134                    } 
    135135                } 
     
    145145        if (strlen($this->arrSql['search_email_mobile']) > 0) { 
    146146            //カンマ区切りで複数の条件指定可能に 
    147             $this->arrSql['search_email_mobile'] = explode(",", $this->arrSql['search_email_mobile']); 
    148             $sql_where = ""; 
     147            $this->arrSql['search_email_mobile'] = explode(',', $this->arrSql['search_email_mobile']); 
     148            $sql_where = ''; 
    149149            foreach ($this->arrSql['search_email_mobile'] as $val) { 
    150150                $val = trim($val); 
    151151                //検索条件を含まない 
    152152                if ($this->arrSql['not_email_mobileinc'] == '1') { 
    153                     if ($sql_where == "") { 
    154                         $sql_where .= "dtb_customer.email_mobile NOT ILIKE ? "; 
     153                    if ($sql_where == '') { 
     154                        $sql_where .= 'dtb_customer.email_mobile NOT ILIKE ? '; 
    155155                    } else { 
    156                         $sql_where .= "AND dtb_customer.email_mobile NOT ILIKE ? "; 
     156                        $sql_where .= 'AND dtb_customer.email_mobile NOT ILIKE ? '; 
    157157                    } 
    158158                } else { 
    159                     if ($sql_where == "") { 
    160                         $sql_where .= "dtb_customer.email_mobile ILIKE ? "; 
     159                    if ($sql_where == '') { 
     160                        $sql_where .= 'dtb_customer.email_mobile ILIKE ? '; 
    161161                    } else { 
    162                         $sql_where .= "OR dtb_customer.email_mobile ILIKE ? "; 
     162                        $sql_where .= 'OR dtb_customer.email_mobile ILIKE ? '; 
    163163                    } 
    164164                } 
     
    174174            if (isset($this->arrSql['search_htmlmail'])) { 
    175175                if (SC_Utils_Ex::sfIsInt($this->arrSql['search_htmlmail'])) { 
    176                     $this->setWhere("mailmaga_flg = ?"); 
     176                    $this->setWhere('mailmaga_flg = ?'); 
    177177                    $this->arrVal[] = $this->arrSql['search_htmlmail']; 
    178178                } else { 
    179179                    // メルマガ購読拒否は省く 
    180                     $this->setWhere("mailmaga_flg <> 3"); 
     180                    $this->setWhere('mailmaga_flg <> 3'); 
    181181                } 
    182182            } 
     
    248248        if (!isset($this->arrSql['search_birth_month'])) $this->arrSql['search_birth_month'] = ""; 
    249249        if (is_numeric($this->arrSql['search_birth_month'])) { 
    250             $this->setWhere(" EXTRACT(month from birth) = ?"); 
     250            $this->setWhere(' EXTRACT(month from birth) = ?'); 
    251251            $this->arrVal[] = $this->arrSql['search_birth_month']; 
    252252        } 
     
    289289        if (!isset($this->arrSql['search_buy_product_code'])) $this->arrSql['search_buy_product_code'] = ""; 
    290290        if (strlen($this->arrSql['search_buy_product_code']) > 0) { 
    291             $this->setWhere("customer_id IN (SELECT customer_id FROM dtb_order WHERE order_id IN (SELECT order_id FROM dtb_order_detail WHERE product_code LIKE ?) AND del_flg = 0)"); 
     291            $this->setWhere('customer_id IN (SELECT customer_id FROM dtb_order WHERE order_id IN (SELECT order_id FROM dtb_order_detail WHERE product_code LIKE ?) AND del_flg = 0)'); 
    292292            $search_buyproduct_code = $this->addSearchStr($this->arrSql['search_buy_product_code']); 
    293293            $this->arrVal[] = $search_buyproduct_code; 
     
    297297        if (!isset($this->arrSql['search_buy_product_name'])) $this->arrSql['search_buy_product_name'] = ""; 
    298298        if (strlen($this->arrSql['search_buy_product_name']) > 0) { 
    299             $this->setWhere("customer_id IN (SELECT customer_id FROM dtb_order WHERE order_id IN (SELECT order_id FROM dtb_order_detail WHERE product_name LIKE ?) AND del_flg = 0)"); 
     299            $this->setWhere('customer_id IN (SELECT customer_id FROM dtb_order WHERE order_id IN (SELECT order_id FROM dtb_order_detail WHERE product_name LIKE ?) AND del_flg = 0)'); 
    300300            $search_buyproduct_name = $this->addSearchStr($this->arrSql['search_buy_product_name']); 
    301301            $this->arrVal[] = $search_buyproduct_name; 
     
    309309 
    310310            // カテゴリで絞込みが可能の場合 
    311             if ($tmp_where != "") { 
    312                 $this->setWhere(" customer_id IN (SELECT distinct customer_id FROM dtb_order WHERE order_id IN (SELECT distinct order_id FROM dtb_order_detail WHERE product_id IN (SELECT product_id FROM dtb_product_categories WHERE ".$tmp_where.") AND del_flg = 0)) "); 
     311            if ($tmp_where != '') { 
     312                $this->setWhere(' customer_id IN (SELECT distinct customer_id FROM dtb_order WHERE order_id IN (SELECT distinct order_id FROM dtb_order_detail WHERE product_id IN (SELECT product_id FROM dtb_product_categories WHERE '.$tmp_where.') AND del_flg = 0)) '); 
    313313                $this->arrVal = array_merge((array)$this->arrVal, (array)$tmp_arrval); 
    314314            } 
     
    324324        } 
    325325 
    326         $this->setOrder("customer_id DESC"); 
     326        $this->setOrder('customer_id DESC'); 
    327327    } 
    328328 
    329329    // 検索用SQL 
    330330    function getList() { 
    331         $this->select = "SELECT customer_id,name01,name02,kana01,kana02,sex,email,email_mobile,tel01,tel02,tel03,pref,status,update_date,mailmaga_flg FROM dtb_customer "; 
     331        $this->select = 'SELECT customer_id,name01,name02,kana01,kana02,sex,email,email_mobile,tel01,tel02,tel03,pref,status,update_date,mailmaga_flg FROM dtb_customer '; 
    332332        return $this->getSql(0); 
    333333    } 
     
    346346    // 検索総数カウント用SQL 
    347347    function getListCount() { 
    348         $this->select = "SELECT COUNT(customer_id) FROM dtb_customer "; 
     348        $this->select = 'SELECT COUNT(customer_id) FROM dtb_customer '; 
    349349        return $this->getSql(1); 
    350350    } 
     
    355355        $i = 0; 
    356356        foreach ($this->arrColumnCSV as $val) { 
    357             if ($i != 0) $state .= ", "; 
     357            if ($i != 0) $state .= ', '; 
    358358            $state .= $val['sql']; 
    359359            $i ++; 
    360360        } 
    361361 
    362         $this->select = "SELECT " .$state. " FROM dtb_customer "; 
     362        $this->select = 'SELECT ' .$state. ' FROM dtb_customer '; 
    363363        return $this->getSql(2); 
    364364    } 
Note: See TracChangeset for help on using the changeset viewer.