Ignore:
Timestamp:
2007/07/20 15:58:59 (19 years ago)
Author:
nanasess
Message:

r15064 から svn cp
とりあえず暫定コミット.

  • UTF-8 に変更
  • slib.php, glib.php のクラス化
  • LC_Page の抽象化(一部)
Location:
branches/feature-module-update
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update

    • Property svn:ignore set to
      .cache

      .settings

      .projectOptions
  • branches/feature-module-update/data/class/SC_CustomerList.php

    r12157 r15078  
    66 */ 
    77 
    8 /*  [̾¾Î] SC_CustomerList 
    9  *  [³µÍ×] ²ñ°÷¸¡º÷ÍÑ¥¯¥é¥¹ 
     8/*  [名称] SC_CustomerList 
     9 *  [概要] 会員検索用クラス 
    1010 */ 
    1111class SC_CustomerList extends SC_SelectSql { 
     
    1717         
    1818        if($mode == "") { 
    19             // ²ñ°÷ËÜÅÐÏ¿²ñ°÷¤Çºï½ü¤·¤Æ¤¤¤Ê¤¤²ñ°÷ 
     19            // 会員本登録会員で削除していない会員 
    2020            $this->setWhere("status = 2 AND del_flg = 0 ");      
    21             // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à 
     21            // 登録日を示すカラム 
    2222            $regdate_col = 'dtb_customer.update_date'; 
    2323        } 
    2424         
    2525        if($mode == "customer") { 
    26             // ´ÉÍý¼Ô¥Ú¡¼¥¸¸ÜµÒ¸¡º÷¤Î¾ì¹ç²¾ÅÐÏ¿²ñ°÷¤â¸¡º÷ 
     26            // 管理者ページ顧客検索の場合仮登録会員も検索 
    2727            $this->setWhere( "(status = 1 OR status = 2) AND del_flg = 0 ");         
    28             // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à 
     28            // 登録日を示すカラム 
    2929            $regdate_col = 'dtb_customer.update_date'; 
    3030        } 
    3131                 
    32         // ¥á¡¼¥ë¥Þ¥¬¥¸¥ó¤Î¾ì¹ç      
     32        // メールマガジンの場合        
    3333        if($mode == "magazine") { 
    3434            $this->setWhere("(del_flg = 0 OR del_flg IS NULL)"); 
    3535            $this->setWhere("status = 2"); 
    3636             
    37             /*¡¡²ñ°÷¤Î¤ßÂоݤȤ¹¤ë¤¿¤áºï½ü 
     37            /* 会員のみ対象とするため削除 
    3838            if(is_array($this->arrSql['customer'])) { 
    3939                $tmp_where = ""; 
     
    4343                    }                    
    4444                    switch($val) { 
    45                     // ²ñ°÷ 
     45                    // 会員 
    4646                    case '1': 
    4747                        $tmp_where.= "status = 2"; 
    4848                        break; 
    49                     // ¥á¥ë¥Þ¥¬ÅÐÏ¿ 
     49                    // メルマガ登録 
    5050                    case '2': 
    5151                        $tmp_where.= "customer_id IS NULL"; 
    5252                        break; 
    53                     // CSVÅÐÏ¿ 
     53                    // CSV登録 
    5454                    case '3': 
    5555                        $tmp_where.= "customer_id IS NULL"; 
     
    6666            } 
    6767            */ 
    68             // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à 
     68            // 登録日を示すカラム 
    6969            $regdate_col = 'dtb_customer.create_date'; 
    7070        } 
    7171                 
    72         // ¸ÜµÒID 
     72        // 顧客ID 
    7373        if ( strlen($this->arrSql['customer_id']) > 0 ) { 
    7474            $this->setWhere( "customer_id =  ?" ); 
     
    7676        } 
    7777         
    78         // ̾Á° 
     78        // 名前 
    7979        if ( strlen($this->arrSql['name']) > 0 ) { 
    8080            if(DB_TYPE == "pgsql"){ 
     
    8585 
    8686            $searchName = $this->addSearchStr($this->arrSql['name']); 
    87             $this->arrVal[] = mb_ereg_replace("[ ¡¡]+","",$searchName); 
    88         } 
    89  
    90         //¡¡Ì¾Á°¡Ê¥«¥Ê¡Ë 
     87            $this->arrVal[] = mb_ereg_replace("[  ]+","",$searchName); 
     88        } 
     89 
     90        // 名前(カナ) 
    9191        if ( strlen($this->arrSql['kana']) > 0 ) { 
    9292            if(DB_TYPE == "pgsql"){ 
     
    9696            } 
    9797            $searchKana = $this->addSearchStr($this->arrSql['kana']); 
    98             $this->arrVal[] = mb_ereg_replace("[ ¡¡]+","",$searchKana); 
    99         } 
    100          
    101         //¡¡ÅÔÆ»Éܸ© 
     98            $this->arrVal[] = mb_ereg_replace("[  ]+","",$searchKana); 
     99        } 
     100         
     101        // 都道府県 
    102102        if ( strlen($this->arrSql['pref']) > 0 ) { 
    103103            $this->setWhere( "pref = ?" ); 
     
    105105        } 
    106106 
    107         //¡¡ÅÅÏÃÈÖ¹æ 
     107        // 電話番号 
    108108        if ( is_numeric( $this->arrSql['tel'] ) ) { 
    109109            if(DB_TYPE == "pgsql"){ 
     
    116116        } 
    117117         
    118         //¡¡À­ÊÌ 
     118        // 性別 
    119119        if ( is_array( $this->arrSql['sex'] ) ){ 
    120120            $arrSexVal = $this->setItemTerm( $this->arrSql['sex'] ,"sex" ); 
     
    124124        } 
    125125 
    126         //¡¡¿¦¶È 
     126        // 職業 
    127127        if ( is_array( $this->arrSql['job'] ) ){ 
    128             if ( in_array("ÉÔÌÀ", $this->arrSql['job'] ) ) { 
     128            if ( in_array("不明", $this->arrSql['job'] ) ) { 
    129129                $arrJobVal = $this->setItemTermWithNull( $this->arrSql['job'] ,"job" ); 
    130130            } else { 
     
    138138        } 
    139139 
    140         //¡¡E-MAIL 
     140        // E-MAIL 
    141141        if (strlen($this->arrSql['email']) > 0) { 
    142             //¥«¥ó¥Þ¶èÀÚ¤ê¤ÇÊ£¿ô¤Î¾ò·ï»ØÄê²Äǽ¤Ë 
     142            //カンマ区切りで複数の条件指定可能に 
    143143            $this->arrSql['email'] = explode(",", $this->arrSql['email']); 
    144144            $sql_where = ""; 
    145145            foreach($this->arrSql['email'] as $val) { 
    146146                $val = trim($val); 
    147                 //¸¡º÷¾ò·ï¤ò´Þ¤Þ¤Ê¤¤ 
     147                //検索条件を含まない 
    148148                if($this->arrSql['not_emailinc'] == '1') { 
    149149                    if($sql_where == "") { 
     
    165165        } 
    166166 
    167         //¡¡E-MAIL(mobile) 
     167        // E-MAIL(mobile) 
    168168        if (strlen($this->arrSql['email_mobile']) > 0) { 
    169             //¥«¥ó¥Þ¶èÀÚ¤ê¤ÇÊ£¿ô¤Î¾ò·ï»ØÄê²Äǽ¤Ë 
     169            //カンマ区切りで複数の条件指定可能に 
    170170            $this->arrSql['email_mobile'] = explode(",", $this->arrSql['email_mobile']); 
    171171            $sql_where = ""; 
    172172            foreach($this->arrSql['email_mobile'] as $val) { 
    173173                $val = trim($val); 
    174                 //¸¡º÷¾ò·ï¤ò´Þ¤Þ¤Ê¤¤ 
     174                //検索条件を含まない 
    175175                if($this->arrSql['not_email_mobileinc'] == '1') { 
    176176                    if($sql_where == "") { 
     
    192192        } 
    193193                 
    194         //¡¡ÇÛ¿®¥á¡¼¥ë¥¢¥É¥ì¥¹¼ïÊÌ 
     194        // 配信メールアドレス種別 
    195195        if ( $mode == 'magazine' ){ 
    196196            if ( strlen($this->arrSql['mail_type']) > 0 && $this->arrSql['mail_type'] == 2) { 
     
    199199        } 
    200200                             
    201         //¡¡HTML-mail 
     201        // HTML-mail 
    202202        if ( $mode == 'magazine' ){ 
    203203            if ( strlen($this->arrSql['htmlmail']) > 0 ) { 
     
    209209        } 
    210210         
    211         // ¹ØÆþ¶â³Û»ØÄê 
     211        // 購入金額指定 
    212212        if( is_numeric( $this->arrSql["buy_total_from"] ) || is_numeric( $this->arrSql["buy_total_to"] ) ) { 
    213213            $arrBuyTotal = $this->selectRange($this->arrSql["buy_total_from"], $this->arrSql["buy_total_to"], "buy_total"); 
     
    217217        } 
    218218 
    219         // ¹ØÆþ²ó¿ô»ØÄê 
     219        // 購入回数指定 
    220220        if( is_numeric( $this->arrSql["buy_times_from"] ) || is_numeric( $this->arrSql["buy_times_to"] ) ) { 
    221221            $arrBuyTimes = $this->selectRange($this->arrSql["buy_times_from"], $this->arrSql["buy_times_to"], "buy_times"); 
     
    225225        } 
    226226         
    227         // ÃÂÀ¸Æü´ü´Ö»ØÄê 
     227        // 誕生日期間指定 
    228228        if ( (strlen($this->arrSql['b_start_year']) > 0 && strlen($this->arrSql['b_start_month']) > 0 && strlen($this->arrSql['b_start_day']) > 0) || 
    229229              strlen($this->arrSql['b_end_year']) > 0 && strlen($this->arrSql['b_end_month']) > 0 && strlen($this->arrSql['b_end_day']) > 0) { 
     
    238238        } 
    239239                 
    240         // ÃÂÀ¸·î¤Î¸¡º÷ 
     240        // 誕生月の検索 
    241241        if (is_numeric($this->arrSql["birth_month"])) { 
    242242            $this->setWhere(" EXTRACT(month from birth) = ?");   
     
    244244        } 
    245245             
    246         // ÅÐÏ¿´ü´Ö»ØÄê 
     246        // 登録期間指定 
    247247        if ( (strlen($this->arrSql['start_year']) > 0 && strlen($this->arrSql['start_month']) > 0 && strlen($this->arrSql['start_day']) > 0 ) ||  
    248248                (strlen($this->arrSql['end_year']) > 0 && strlen($this->arrSql['end_month']) >0 && strlen($this->arrSql['end_day']) > 0) ) { 
     
    257257        } 
    258258             
    259         // ºÇ½ª¹ØÆþÆü»ØÄê 
     259        // 最終購入日指定 
    260260        if ( (strlen($this->arrSql['buy_start_year']) > 0 && strlen($this->arrSql['buy_start_month']) > 0 && strlen($this->arrSql['buy_start_day']) > 0 ) ||  
    261261                (strlen($this->arrSql['buy_end_year']) > 0 && strlen($this->arrSql['buy_end_month']) >0 && strlen($this->arrSql['buy_end_day']) > 0) ) { 
     
    269269        } 
    270270         
    271         //¹ØÆþ¾¦ÉÊ¥³¡¼¥É 
     271        //購入商品コード 
    272272        if ( strlen($this->arrSql['buy_product_code']) > 0 ) { 
    273273            $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 ? ))"); 
     
    276276        } 
    277277 
    278         //¹ØÆþ¾¦ÉÊ̾¾Î 
     278        //購入商品名称 
    279279        if ( strlen($this->arrSql['buy_product_name']) > 0 ) { 
    280280            $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 ? ))"); 
     
    283283        } 
    284284         
    285         //¥«¥Æ¥´¥ê¡¼¤òÁªÂò¤·¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¹Ê¹þ¸¡º÷¤ò¹Ô¤¦ 
     285        //カテゴリーを選択している場合のみ絞込検索を行う 
    286286        if ( strlen($this->arrSql['category_id']) != ""){ 
    287             //¥«¥Æ¥´¥ê¡¼¤Ç¹Ê¹þ¸¡º÷¤ò¹Ô¤¦SQLʸÀ¸À® 
     287            //カテゴリーで絞込検索を行うSQL文生成 
    288288            list($tmp_where, $tmp_arrval) = sfGetCatWhere(sfManualEscape($this->arrSql['category_id'])); 
    289289 
    290             //¥«¥Æ¥´¥ê¡¼¤Ç¹Ê¹þ¤ß¤¬²Äǽ¤Î¾ì¹ç 
     290            //カテゴリーで絞込みが可能の場合 
    291291            if($tmp_where != "") { 
    292292                $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_products WHERE ".$tmp_where." ))) "); 
     
    294294            } 
    295295        } 
    296         //¡¡·ÈÂÓÅÅÏÃÈÖ¹æ 
     296        // 携帯電話番号 
    297297        if ( is_numeric( $this->arrSql['cell'] ) ) { 
    298298            $this->setWhere( "(cell01 || cell02 || cell03 LIKE ?)" ); 
     
    301301        } 
    302302 
    303         //¡¡¥­¥ã¥ó¥Ú¡¼¥ó 
     303        // キャンペーン 
    304304        if ( is_numeric( $this->arrSql['campaign_id'] ) ) { 
    305305            $this->setWhere( " customer_id IN (SELECT distinct customer_id FROM dtb_campaign_order WHERE campaign_id = ?)" ); 
     
    310310    } 
    311311 
    312     // ¸¡º÷ÍÑSQL 
     312    // 検索用SQL 
    313313    function getList() { 
    314314        $this->select = "SELECT customer_id,name01,name02,kana01,kana02,sex,email,tel01,tel02,tel03,pref,status FROM dtb_customer "; 
     
    350350    } 
    351351     
    352     //¡¡¸¡º÷Áí¿ô¥«¥¦¥ó¥ÈÍÑSQL 
     352    // 検索総数カウント用SQL 
    353353    function getListCount() { 
    354354        $this->select = "SELECT COUNT(customer_id) FROM dtb_customer ";  
     
    356356    } 
    357357 
    358     //¡¡CSV¥À¥¦¥ó¥í¡¼¥ÉÍÑSQL 
     358    // CSVダウンロード用SQL 
    359359    function getListCSV($arrColumnCSV) { 
    360360        $this->arrColumnCSV = $arrColumnCSV; 
Note: See TracChangeset for help on using the changeset viewer.