Changeset 11984 for branches/comu/data/class/SC_CustomerList.php
- Timestamp:
- 2007/03/28 15:05:09 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu/data/class/SC_CustomerList.php
r11730 r11984 67 67 */ 68 68 // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à 69 $regdate_col = 'dtb_customer _mail.create_date';69 $regdate_col = 'dtb_customer.create_date'; 70 70 } 71 71 … … 164 164 $this->setWhere($sql_where); 165 165 } 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 166 201 //¡¡HTML-mail 167 202 if ( $mode == 'magazine' ){ 168 203 if ( strlen($this->arrSql['htmlmail']) > 0 ) { 169 $this->setWhere( " mail _flag = ? ");204 $this->setWhere( " mailmaga_flg = ? "); 170 205 $this->arrVal[] = $this->arrSql['htmlmail']; 171 206 } else { 172 $this->setWhere( " (mail _flag = 1 or mail_flag = 2) ");207 $this->setWhere( " (mailmaga_flg = 1 or mailmaga_flg = 2) "); 173 208 } 174 209 } … … 281 316 } 282 317 283 function getListMailMagazine() { 318 function getListMailMagazine($is_mobile = false) { 319 320 $colomn = $this->getMailMagazineColumn($is_mobile); 284 321 $this->select = " 285 322 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, 287 337 dtb_customer.name01, 288 338 dtb_customer.name02, … … 290 340 dtb_customer.kana02, 291 341 dtb_customer.sex, 292 dtb_customer.email,342 $email_column, 293 343 dtb_customer.tel01, 294 344 dtb_customer.tel02, 295 345 dtb_customer.tel03, 296 346 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; 301 350 } 302 351 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 //¹ØÆþ¾¦ÉÊ¥³¡¼¥É¸¡º÷ÍÑSQL308 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_code310 FROM (dtb_customer LEFT OUTER JOIN dtb_customer_mail USING (email)) AS A LEFT OUTER JOIN dtb_order AS B ON311 A.email=B.order_email LEFT OUTER JOIN dtb_order_detail AS C ON B.order_id = C.order_id";312 }313 314 352 //¡¡¸¡º÷Áí¿ô¥«¥¦¥ó¥ÈÍÑSQL 315 353 function getListCount() {
Note: See TracChangeset
for help on using the changeset viewer.