Changeset 15362 for branches/beta
- Timestamp:
- 2007/08/27 11:36:40 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/beta/data/class/SC_CustomerList.php
r14676 r15362 5 5 * http://www.lockon.co.jp/ 6 6 */ 7 $INC_PATH = realpath( dirname( __FILE__) ); 8 require( $INC_PATH ."/../conf/conf.php" ); 7 9 8 /* [̾¾Î] SC_CustomerList 10 9 * [³µÍ×] ²ñ°÷¸¡º÷ÍÑ¥¯¥é¥¹ … … 13 12 14 13 var $arrColumnCSV; 15 14 16 15 function SC_CustomerList($array, $mode = '') { 17 16 parent::SC_SelectSql($array); 18 17 19 18 if($mode == "") { 20 19 // ²ñ°÷ËÜÅÐÏ¿²ñ°÷¤Çºï½ü¤·¤Æ¤¤¤Ê¤¤²ñ°÷ 21 $this->setWhere("status = 2 AND del_flg = 0 "); 20 $this->setWhere("status = 2 AND del_flg = 0 "); 22 21 // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à 23 22 $regdate_col = 'dtb_customer.update_date'; 24 23 } 25 24 26 25 if($mode == "customer") { 27 26 // ´ÉÍý¼Ô¥Ú¡¼¥¸¸ÜµÒ¸¡º÷¤Î¾ì¹ç²¾ÅÐÏ¿²ñ°÷¤â¸¡º÷ 28 $this->setWhere( "(status = 1 OR status = 2) AND del_flg = 0 "); 27 $this->setWhere( "(status = 1 OR status = 2) AND del_flg = 0 "); 29 28 // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à 30 29 $regdate_col = 'dtb_customer.update_date'; 31 30 } 32 33 // ¥á¡¼¥ë¥Þ¥¬¥¸¥ó¤Î¾ì¹ç 31 32 // ¥á¡¼¥ë¥Þ¥¬¥¸¥ó¤Î¾ì¹ç 34 33 if($mode == "magazine") { 35 34 $this->setWhere("(del_flg = 0 OR del_flg IS NULL)"); 36 35 $this->setWhere("status = 2"); 37 36 38 37 /*¡¡²ñ°÷¤Î¤ßÂоݤȤ¹¤ë¤¿¤áºï½ü 39 38 if(is_array($this->arrSql['customer'])) { … … 42 41 if($tmp_where != "") { 43 42 $tmp_where.= " OR "; 44 } 43 } 45 44 switch($val) { 46 45 // ²ñ°÷ … … 70 69 $regdate_col = 'dtb_customer.create_date'; 71 70 } 72 71 73 72 // ¸ÜµÒID 74 73 if ( strlen($this->arrSql['customer_id']) > 0 ) { … … 76 75 $this->arrVal[] = $this->arrSql['customer_id']; 77 76 } 78 77 79 78 // ̾Á° 80 79 if ( strlen($this->arrSql['name']) > 0 ) { … … 99 98 $this->arrVal[] = mb_ereg_replace("[ ¡¡]+","",$searchKana); 100 99 } 101 100 102 101 //¡¡ÅÔÆ»Éܸ© 103 102 if ( strlen($this->arrSql['pref']) > 0 ) { … … 116 115 $this->arrVal[] = ereg_replace("-", "", $searchTel); 117 116 } 118 117 119 118 //¡¡ÀÊÌ 120 119 if ( is_array( $this->arrSql['sex'] ) ){ … … 153 152 $sql_where .= "AND dtb_customer.email NOT ILIKE ? "; 154 153 } 155 } else { 154 } else { 156 155 if($sql_where == "") { 157 156 $sql_where .= "dtb_customer.email ILIKE ? "; … … 180 179 $sql_where .= "AND dtb_customer.email_mobile NOT ILIKE ? "; 181 180 } 182 } else { 181 } else { 183 182 if($sql_where == "") { 184 183 $sql_where .= "dtb_customer.email_mobile ILIKE ? "; … … 193 192 } 194 193 195 /* 2007/05/28 °ìö¡¢Ää»ß¤·¤Þ¤¹¡£ 194 /* 2007/05/28 °ìö¡¢Ää»ß¤·¤Þ¤¹¡£ 196 195 * //¡¡ÇÛ¿®¥á¡¼¥ë¥¢¥É¥ì¥¹¼ïÊÌ 197 196 * if ( $mode == 'magazine' ){ … … 238 237 } 239 238 } 240 239 241 240 // ¹ØÆþ¶â³Û»ØÄê 242 241 if( is_numeric( $this->arrSql["buy_total_from"] ) || is_numeric( $this->arrSql["buy_total_to"] ) ) { … … 254 253 } 255 254 } 256 255 257 256 // ÃÂÀ¸Æü´ü´Ö»ØÄê 258 257 if ( (strlen($this->arrSql['b_start_year']) > 0 && strlen($this->arrSql['b_start_month']) > 0 && strlen($this->arrSql['b_start_day']) > 0) || … … 267 266 } 268 267 } 269 268 270 269 // ÃÂÀ¸·î¤Î¸¡º÷ 271 270 if (is_numeric($this->arrSql["birth_month"])) { 272 $this->setWhere(" EXTRACT(month from birth) = ?"); 271 $this->setWhere(" EXTRACT(month from birth) = ?"); 273 272 $this->arrVal[] = $this->arrSql["birth_month"]; 274 273 } 275 274 276 275 // ÅÐÏ¿´ü´Ö»ØÄê 277 if ( (strlen($this->arrSql['start_year']) > 0 && strlen($this->arrSql['start_month']) > 0 && strlen($this->arrSql['start_day']) > 0 ) || 276 if ( (strlen($this->arrSql['start_year']) > 0 && strlen($this->arrSql['start_month']) > 0 && strlen($this->arrSql['start_day']) > 0 ) || 278 277 (strlen($this->arrSql['end_year']) > 0 && strlen($this->arrSql['end_month']) >0 && strlen($this->arrSql['end_day']) > 0) ) { 279 278 … … 286 285 } 287 286 } 288 287 289 288 // ºÇ½ª¹ØÆþÆü»ØÄê 290 if ( (strlen($this->arrSql['buy_start_year']) > 0 && strlen($this->arrSql['buy_start_month']) > 0 && strlen($this->arrSql['buy_start_day']) > 0 ) || 289 if ( (strlen($this->arrSql['buy_start_year']) > 0 && strlen($this->arrSql['buy_start_month']) > 0 && strlen($this->arrSql['buy_start_day']) > 0 ) || 291 290 (strlen($this->arrSql['buy_end_year']) > 0 && strlen($this->arrSql['buy_end_month']) >0 && strlen($this->arrSql['buy_end_day']) > 0) ) { 292 291 $arrRegistTime = $this->selectTermRange($this->arrSql['buy_start_year'], $this->arrSql['buy_start_month'], $this->arrSql['buy_start_day'] … … 298 297 } 299 298 } 300 299 301 300 //¹ØÆþ¾¦ÉÊ¥³¡¼¥É 302 301 if ( strlen($this->arrSql['buy_product_code']) > 0 ) { … … 312 311 $this->arrVal[] = $search_buyproduct_name; 313 312 } 314 313 315 314 //¥«¥Æ¥´¥ê¡¼¤òÁªÂò¤·¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¹Ê¹þ¸¡º÷¤ò¹Ô¤¦ 316 315 if ( strlen($this->arrSql['category_id']) != ""){ … … 336 335 $this->arrVal[] = $this->arrSql['campaign_id']; 337 336 } 338 337 339 338 $this->setOrder( "customer_id DESC" ); 340 339 } … … 343 342 function getList() { 344 343 $this->select = "SELECT customer_id,name01,name02,kana01,kana02,sex,email,tel01,tel02,tel03,pref,status FROM dtb_customer "; 345 return $this->getSql(0); 344 return $this->getSql(0); 346 345 } 347 346 348 347 function getListMailMagazine($is_mobile = false) { 349 348 350 349 $colomn = $this->getMailMagazineColumn($is_mobile); 351 350 $this->select = " 352 SELECT 351 SELECT 353 352 $colomn 354 FROM 353 FROM 355 354 dtb_customer"; 356 return $this->getSql(0); 357 } 358 355 return $this->getSql(0); 356 } 357 359 358 function getMailMagazineColumn($is_mobile= false) { 360 359 if($is_mobile == true) { 361 360 $email_column = "dtb_customer.email_mobile as email"; 362 361 } else { 363 $email_column = "dtb_customer.email"; 364 } 365 362 $email_column = "dtb_customer.email"; 363 } 364 366 365 $column ="dtb_customer.customer_id, 367 366 dtb_customer.name01, … … 370 369 dtb_customer.kana02, 371 370 dtb_customer.sex, 372 $email_column, 371 $email_column, 373 372 dtb_customer.tel01, 374 373 dtb_customer.tel02, 375 374 dtb_customer.tel03, 376 dtb_customer.pref, 375 dtb_customer.pref, 377 376 dtb_customer.mailmaga_flg"; 378 377 379 378 return $column; 380 379 } 381 380 382 381 //¡¡¸¡º÷Áí¿ô¥«¥¦¥ó¥ÈÍÑSQL 383 382 function getListCount() { 384 $this->select = "SELECT COUNT(customer_id) FROM dtb_customer "; 383 $this->select = "SELECT COUNT(customer_id) FROM dtb_customer "; 385 384 return $this->getSql(1); 386 385 } … … 397 396 398 397 $this->select = "SELECT " .$state. " FROM dtb_customer "; 399 return $this->getSql(2); 400 } 401 398 return $this->getSql(2); 399 } 400 402 401 function getWhere() { 403 402 return array($this->where, $this->arrVal);
Note: See TracChangeset
for help on using the changeset viewer.