Ignore:
Timestamp:
2007/03/28 15:05:09 (17 years ago)
Author:
uehara
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu/data/class/SC_CustomerList.php

    r11730 r11984  
    6767            */ 
    6868            // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à 
    69             $regdate_col = 'dtb_customer_mail.create_date'; 
     69            $regdate_col = 'dtb_customer.create_date'; 
    7070        } 
    7171                 
     
    164164            $this->setWhere($sql_where); 
    165165        } 
     166 
     167        //¡¡E-MAIL(mobile) 
     168        if (strlen($this->arrSql['email_mobile']) > 0) { 
     169            //¥«¥ó¥Þ¶èÀÚ¤ê¤ÇÊ£¿ô¤Î¾ò·ï»ØÄê²Äǽ¤Ë 
     170            $this->arrSql['email_mobile'] = explode(",", $this->arrSql['email_mobile']); 
     171            $sql_where = ""; 
     172            foreach($this->arrSql['email_mobile'] as $val) { 
     173                $val = trim($val); 
     174                //¸¡º÷¾ò·ï¤ò´Þ¤Þ¤Ê¤¤ 
     175                if($this->arrSql['not_email_mobileinc'] == '1') { 
     176                    if($sql_where == "") { 
     177                        $sql_where .= "dtb_customer.email_mobile NOT ILIKE ? "; 
     178                    } else { 
     179                        $sql_where .= "AND dtb_customer.email_mobile NOT ILIKE ? "; 
     180                    } 
     181                } else {                 
     182                    if($sql_where == "") { 
     183                        $sql_where .= "dtb_customer.email_mobile ILIKE ? "; 
     184                    } else { 
     185                        $sql_where .= "OR dtb_customer.email_mobile ILIKE ? "; 
     186                    } 
     187                } 
     188                $searchemail_mobile = $this->addSearchStr($val); 
     189                $this->arrVal[] = $searchemail_mobile; 
     190            } 
     191            $this->setWhere($sql_where); 
     192        } 
     193                 
     194        //¡¡ÇÛ¿®¥á¡¼¥ë¥¢¥É¥ì¥¹¼ïÊÌ 
     195        if ( $mode == 'magazine' ){ 
     196            if ( strlen($this->arrSql['mail_type']) > 0 && $this->arrSql['mail_type'] == 2) { 
     197                $this->setWhere( " dtb_customer.email_mobile <> ''  "); 
     198            } 
     199        } 
     200                             
    166201        //¡¡HTML-mail 
    167202        if ( $mode == 'magazine' ){ 
    168203            if ( strlen($this->arrSql['htmlmail']) > 0 ) { 
    169                 $this->setWhere( " mail_flag = ? "); 
     204                $this->setWhere( " mailmaga_flg = ? "); 
    170205                $this->arrVal[] = $this->arrSql['htmlmail']; 
    171206            } else { 
    172                 $this->setWhere( " (mail_flag = 1 or mail_flag = 2) "); 
     207                $this->setWhere( " (mailmaga_flg = 1 or mailmaga_flg = 2) "); 
    173208            } 
    174209        } 
     
    281316    } 
    282317 
    283     function getListMailMagazine() { 
     318    function getListMailMagazine($is_mobile = false) { 
     319             
     320        $colomn = $this->getMailMagazineColumn($is_mobile); 
    284321        $this->select = " 
    285322            SELECT  
    286                 dtb_customer.customer_id, 
     323                $colomn 
     324            FROM  
     325                dtb_customer"; 
     326        return $this->getSql(0);     
     327    } 
     328     
     329    function getMailMagazineColumn($is_mobile= false) { 
     330        if($is_mobile == true) { 
     331            $email_column = "dtb_customer.email_mobile as email"; 
     332        } else { 
     333            $email_column = "dtb_customer.email";            
     334        } 
     335         
     336        $column ="dtb_customer.customer_id, 
    287337                dtb_customer.name01, 
    288338                dtb_customer.name02, 
     
    290340                dtb_customer.kana02, 
    291341                dtb_customer.sex, 
    292                 dtb_customer.email, 
     342                $email_column,       
    293343                dtb_customer.tel01, 
    294344                dtb_customer.tel02, 
    295345                dtb_customer.tel03, 
    296346                dtb_customer.pref,  
    297                 dtb_customer_mail.mail_flag  
    298             FROM  
    299                 dtb_customer_mail LEFT OUTER JOIN dtb_customer USING(email)"; 
    300         return $this->getSql(0);     
     347                dtb_customer.mailmaga_flg"; 
     348                 
     349        return $column; 
    301350    } 
    302351     
    303     function getListMailMagazineCount() { 
    304         $this->select = "SELECT COUNT(*) FROM dtb_customer_mail LEFT OUTER JOIN dtb_customer USING(email)"; 
    305         return $this->getSql(0);     
    306     } 
    307     //¹ØÆþ¾¦ÉÊ¥³¡¼¥É¸¡º÷ÍÑSQL 
    308     function getBuyList(){ 
    309         $this->select = "SELECT A.customer_id, A.name01, A.name02, A.kana01, A.kana02, A.sex, A.email, A.tel01, A.tel02, A.tel03, A.pref, A.mail_flag, B.order_email, B.order_id, C.product_code  
    310                         FROM (dtb_customer LEFT OUTER JOIN dtb_customer_mail USING (email)) AS A LEFT OUTER JOIN dtb_order AS B ON  
    311                         A.email=B.order_email LEFT OUTER JOIN dtb_order_detail AS C ON B.order_id = C.order_id"; 
    312     } 
    313  
    314352    //¡¡¸¡º÷Áí¿ô¥«¥¦¥ó¥ÈÍÑSQL 
    315353    function getListCount() { 
Note: See TracChangeset for help on using the changeset viewer.