- Timestamp:
- 2007/07/20 15:58:59 (19 years ago)
- Location:
- branches/feature-module-update
- Files:
-
- 1 edited
- 2 copied
-
. (copied) (copied from branches/rel) (1 prop)
-
data (copied) (copied from branches/rel/data)
-
data/class/SC_CustomerList.php (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update
-
Property
svn:ignore
set to
.cache
.settings
.projectOptions
-
Property
svn:ignore
set to
-
branches/feature-module-update/data/class/SC_CustomerList.php
r12157 r15078 6 6 */ 7 7 8 /* [ ̾¾Î] SC_CustomerList9 * [ ³µÍ×] ²ñ°÷¸¡º÷ÍÑ¥¯¥é¥¹8 /* [名称] SC_CustomerList 9 * [概要] 会員検索用クラス 10 10 */ 11 11 class SC_CustomerList extends SC_SelectSql { … … 17 17 18 18 if($mode == "") { 19 // ²ñ°÷ËÜÅÐÏ¿²ñ°÷¤Çºï½ü¤·¤Æ¤¤¤Ê¤¤²ñ°÷19 // 会員本登録会員で削除していない会員 20 20 $this->setWhere("status = 2 AND del_flg = 0 "); 21 // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à21 // 登録日を示すカラム 22 22 $regdate_col = 'dtb_customer.update_date'; 23 23 } 24 24 25 25 if($mode == "customer") { 26 // ´ÉÍý¼Ô¥Ú¡¼¥¸¸ÜµÒ¸¡º÷¤Î¾ì¹ç²¾ÅÐÏ¿²ñ°÷¤â¸¡º÷26 // 管理者ページ顧客検索の場合仮登録会員も検索 27 27 $this->setWhere( "(status = 1 OR status = 2) AND del_flg = 0 "); 28 // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à28 // 登録日を示すカラム 29 29 $regdate_col = 'dtb_customer.update_date'; 30 30 } 31 31 32 // ¥á¡¼¥ë¥Þ¥¬¥¸¥ó¤Î¾ì¹ç32 // メールマガジンの場合 33 33 if($mode == "magazine") { 34 34 $this->setWhere("(del_flg = 0 OR del_flg IS NULL)"); 35 35 $this->setWhere("status = 2"); 36 36 37 /* ¡¡²ñ°÷¤Î¤ßÂоݤȤ¹¤ë¤¿¤áºï½ü37 /* 会員のみ対象とするため削除 38 38 if(is_array($this->arrSql['customer'])) { 39 39 $tmp_where = ""; … … 43 43 } 44 44 switch($val) { 45 // ²ñ°÷45 // 会員 46 46 case '1': 47 47 $tmp_where.= "status = 2"; 48 48 break; 49 // ¥á¥ë¥Þ¥¬ÅÐÏ¿49 // メルマガ登録 50 50 case '2': 51 51 $tmp_where.= "customer_id IS NULL"; 52 52 break; 53 // CSV ÅÐÏ¿53 // CSV登録 54 54 case '3': 55 55 $tmp_where.= "customer_id IS NULL"; … … 66 66 } 67 67 */ 68 // ÅÐÏ¿Æü¤ò¼¨¤¹¥«¥é¥à68 // 登録日を示すカラム 69 69 $regdate_col = 'dtb_customer.create_date'; 70 70 } 71 71 72 // ¸ÜµÒID72 // 顧客ID 73 73 if ( strlen($this->arrSql['customer_id']) > 0 ) { 74 74 $this->setWhere( "customer_id = ?" ); … … 76 76 } 77 77 78 // ̾Á°78 // 名前 79 79 if ( strlen($this->arrSql['name']) > 0 ) { 80 80 if(DB_TYPE == "pgsql"){ … … 85 85 86 86 $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 // 名前(カナ) 91 91 if ( strlen($this->arrSql['kana']) > 0 ) { 92 92 if(DB_TYPE == "pgsql"){ … … 96 96 } 97 97 $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 // 都道府県 102 102 if ( strlen($this->arrSql['pref']) > 0 ) { 103 103 $this->setWhere( "pref = ?" ); … … 105 105 } 106 106 107 // ¡¡ÅÅÏÃÈÖ¹æ107 // 電話番号 108 108 if ( is_numeric( $this->arrSql['tel'] ) ) { 109 109 if(DB_TYPE == "pgsql"){ … … 116 116 } 117 117 118 // ¡¡ÀÊÌ118 // 性別 119 119 if ( is_array( $this->arrSql['sex'] ) ){ 120 120 $arrSexVal = $this->setItemTerm( $this->arrSql['sex'] ,"sex" ); … … 124 124 } 125 125 126 // ¡¡¿¦¶È126 // 職業 127 127 if ( is_array( $this->arrSql['job'] ) ){ 128 if ( in_array(" ÉÔÌÀ", $this->arrSql['job'] ) ) {128 if ( in_array("不明", $this->arrSql['job'] ) ) { 129 129 $arrJobVal = $this->setItemTermWithNull( $this->arrSql['job'] ,"job" ); 130 130 } else { … … 138 138 } 139 139 140 // ¡¡E-MAIL140 // E-MAIL 141 141 if (strlen($this->arrSql['email']) > 0) { 142 // ¥«¥ó¥Þ¶èÀÚ¤ê¤ÇÊ£¿ô¤Î¾ò·ï»ØÄê²Äǽ¤Ë142 //カンマ区切りで複数の条件指定可能に 143 143 $this->arrSql['email'] = explode(",", $this->arrSql['email']); 144 144 $sql_where = ""; 145 145 foreach($this->arrSql['email'] as $val) { 146 146 $val = trim($val); 147 // ¸¡º÷¾ò·ï¤ò´Þ¤Þ¤Ê¤¤147 //検索条件を含まない 148 148 if($this->arrSql['not_emailinc'] == '1') { 149 149 if($sql_where == "") { … … 165 165 } 166 166 167 // ¡¡E-MAIL(mobile)167 // E-MAIL(mobile) 168 168 if (strlen($this->arrSql['email_mobile']) > 0) { 169 // ¥«¥ó¥Þ¶èÀÚ¤ê¤ÇÊ£¿ô¤Î¾ò·ï»ØÄê²Äǽ¤Ë169 //カンマ区切りで複数の条件指定可能に 170 170 $this->arrSql['email_mobile'] = explode(",", $this->arrSql['email_mobile']); 171 171 $sql_where = ""; 172 172 foreach($this->arrSql['email_mobile'] as $val) { 173 173 $val = trim($val); 174 // ¸¡º÷¾ò·ï¤ò´Þ¤Þ¤Ê¤¤174 //検索条件を含まない 175 175 if($this->arrSql['not_email_mobileinc'] == '1') { 176 176 if($sql_where == "") { … … 192 192 } 193 193 194 // ¡¡ÇÛ¿®¥á¡¼¥ë¥¢¥É¥ì¥¹¼ïÊÌ194 // 配信メールアドレス種別 195 195 if ( $mode == 'magazine' ){ 196 196 if ( strlen($this->arrSql['mail_type']) > 0 && $this->arrSql['mail_type'] == 2) { … … 199 199 } 200 200 201 // ¡¡HTML-mail201 // HTML-mail 202 202 if ( $mode == 'magazine' ){ 203 203 if ( strlen($this->arrSql['htmlmail']) > 0 ) { … … 209 209 } 210 210 211 // ¹ØÆþ¶â³Û»ØÄê211 // 購入金額指定 212 212 if( is_numeric( $this->arrSql["buy_total_from"] ) || is_numeric( $this->arrSql["buy_total_to"] ) ) { 213 213 $arrBuyTotal = $this->selectRange($this->arrSql["buy_total_from"], $this->arrSql["buy_total_to"], "buy_total"); … … 217 217 } 218 218 219 // ¹ØÆþ²ó¿ô»ØÄê219 // 購入回数指定 220 220 if( is_numeric( $this->arrSql["buy_times_from"] ) || is_numeric( $this->arrSql["buy_times_to"] ) ) { 221 221 $arrBuyTimes = $this->selectRange($this->arrSql["buy_times_from"], $this->arrSql["buy_times_to"], "buy_times"); … … 225 225 } 226 226 227 // ÃÂÀ¸Æü´ü´Ö»ØÄê227 // 誕生日期間指定 228 228 if ( (strlen($this->arrSql['b_start_year']) > 0 && strlen($this->arrSql['b_start_month']) > 0 && strlen($this->arrSql['b_start_day']) > 0) || 229 229 strlen($this->arrSql['b_end_year']) > 0 && strlen($this->arrSql['b_end_month']) > 0 && strlen($this->arrSql['b_end_day']) > 0) { … … 238 238 } 239 239 240 // ÃÂÀ¸·î¤Î¸¡º÷240 // 誕生月の検索 241 241 if (is_numeric($this->arrSql["birth_month"])) { 242 242 $this->setWhere(" EXTRACT(month from birth) = ?"); … … 244 244 } 245 245 246 // ÅÐÏ¿´ü´Ö»ØÄê246 // 登録期間指定 247 247 if ( (strlen($this->arrSql['start_year']) > 0 && strlen($this->arrSql['start_month']) > 0 && strlen($this->arrSql['start_day']) > 0 ) || 248 248 (strlen($this->arrSql['end_year']) > 0 && strlen($this->arrSql['end_month']) >0 && strlen($this->arrSql['end_day']) > 0) ) { … … 257 257 } 258 258 259 // ºÇ½ª¹ØÆþÆü»ØÄê259 // 最終購入日指定 260 260 if ( (strlen($this->arrSql['buy_start_year']) > 0 && strlen($this->arrSql['buy_start_month']) > 0 && strlen($this->arrSql['buy_start_day']) > 0 ) || 261 261 (strlen($this->arrSql['buy_end_year']) > 0 && strlen($this->arrSql['buy_end_month']) >0 && strlen($this->arrSql['buy_end_day']) > 0) ) { … … 269 269 } 270 270 271 // ¹ØÆþ¾¦ÉÊ¥³¡¼¥É271 //購入商品コード 272 272 if ( strlen($this->arrSql['buy_product_code']) > 0 ) { 273 273 $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 ? ))"); … … 276 276 } 277 277 278 // ¹ØÆþ¾¦ÉÊ̾¾Î278 //購入商品名称 279 279 if ( strlen($this->arrSql['buy_product_name']) > 0 ) { 280 280 $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 ? ))"); … … 283 283 } 284 284 285 // ¥«¥Æ¥´¥ê¡¼¤òÁªÂò¤·¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¹Ê¹þ¸¡º÷¤ò¹Ô¤¦285 //カテゴリーを選択している場合のみ絞込検索を行う 286 286 if ( strlen($this->arrSql['category_id']) != ""){ 287 // ¥«¥Æ¥´¥ê¡¼¤Ç¹Ê¹þ¸¡º÷¤ò¹Ô¤¦SQLʸÀ¸À®287 //カテゴリーで絞込検索を行うSQL文生成 288 288 list($tmp_where, $tmp_arrval) = sfGetCatWhere(sfManualEscape($this->arrSql['category_id'])); 289 289 290 // ¥«¥Æ¥´¥ê¡¼¤Ç¹Ê¹þ¤ß¤¬²Äǽ¤Î¾ì¹ç290 //カテゴリーで絞込みが可能の場合 291 291 if($tmp_where != "") { 292 292 $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." ))) "); … … 294 294 } 295 295 } 296 // ¡¡·ÈÂÓÅÅÏÃÈÖ¹æ296 // 携帯電話番号 297 297 if ( is_numeric( $this->arrSql['cell'] ) ) { 298 298 $this->setWhere( "(cell01 || cell02 || cell03 LIKE ?)" ); … … 301 301 } 302 302 303 // ¡¡¥¥ã¥ó¥Ú¡¼¥ó303 // キャンペーン 304 304 if ( is_numeric( $this->arrSql['campaign_id'] ) ) { 305 305 $this->setWhere( " customer_id IN (SELECT distinct customer_id FROM dtb_campaign_order WHERE campaign_id = ?)" ); … … 310 310 } 311 311 312 // ¸¡º÷ÍÑSQL312 // 検索用SQL 313 313 function getList() { 314 314 $this->select = "SELECT customer_id,name01,name02,kana01,kana02,sex,email,tel01,tel02,tel03,pref,status FROM dtb_customer "; … … 350 350 } 351 351 352 // ¡¡¸¡º÷Áí¿ô¥«¥¦¥ó¥ÈÍÑSQL352 // 検索総数カウント用SQL 353 353 function getListCount() { 354 354 $this->select = "SELECT COUNT(customer_id) FROM dtb_customer "; … … 356 356 } 357 357 358 // ¡¡CSV¥À¥¦¥ó¥í¡¼¥ÉÍÑSQL358 // CSVダウンロード用SQL 359 359 function getListCSV($arrColumnCSV) { 360 360 $this->arrColumnCSV = $arrColumnCSV;
Note: See TracChangeset
for help on using the changeset viewer.
