Changeset 15642
- Timestamp:
- 2007/09/07 15:24:34 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/SC_CustomerList.php
r15562 r15642 15 15 function SC_CustomerList($array, $mode = '') { 16 16 parent::SC_SelectSql($array); 17 $objDb = new SC_Helper_DB_Ex(); 17 18 18 19 if($mode == "") { … … 71 72 72 73 // 顧客ID 74 if (!isset($this->arrSql['customer_id'])) $this->arrSql['customer_id'] = ""; 73 75 if ( strlen($this->arrSql['customer_id']) > 0 ) { 74 76 $this->setWhere( "customer_id = ?" ); … … 77 79 78 80 // 名前 81 if (!isset($this->arrSql['name'])) $this->arrSql['name'] = ""; 79 82 if ( strlen($this->arrSql['name']) > 0 ) { 80 83 if(DB_TYPE == "pgsql"){ … … 89 92 90 93 // 名前(カナ) 94 if (!isset($this->arrSql['kana'])) $this->arrSql['kana'] = ""; 91 95 if ( strlen($this->arrSql['kana']) > 0 ) { 92 96 if(DB_TYPE == "pgsql"){ … … 100 104 101 105 // 都道府県 106 if (!isset($this->arrSql['pref'])) $this->arrSql['pref'] = ""; 102 107 if ( strlen($this->arrSql['pref']) > 0 ) { 103 108 $this->setWhere( "pref = ?" ); … … 106 111 107 112 // 電話番号 113 if (!isset($this->arrSql['tel'])) $this->arrSql['tel'] = ""; 108 114 if ( is_numeric( $this->arrSql['tel'] ) ) { 109 115 if(DB_TYPE == "pgsql"){ … … 141 147 142 148 // E-MAIL 149 if (!isset($this->arrSql['email'])) $this->arrSql['email'] = ""; 143 150 if (strlen($this->arrSql['email']) > 0) { 144 151 //カンマ区切りで複数の条件指定可能に … … 168 175 169 176 // E-MAIL(mobile) 177 if (!isset($this->arrSql['email_mobile'])) $this->arrSql['email_mobile'] = ""; 170 178 if (strlen($this->arrSql['email_mobile']) > 0) { 171 179 //カンマ区切りで複数の条件指定可能に … … 196 204 // 配信メールアドレス種別 197 205 if ( $mode == 'magazine' ){ 206 if (!isset($this->arrSql['mail_type'])) $this->arrSql['mail_type'] = ""; 198 207 if ( strlen($this->arrSql['mail_type']) > 0 && $this->arrSql['mail_type'] == 2) { 199 208 $this->setWhere( " dtb_customer.email_mobile <> '' "); … … 203 212 // HTML-mail 204 213 if ( $mode == 'magazine' ){ 214 if (!isset($this->arrSql['htmlmail'])) $this->arrSql['htmlmail'] = ""; 205 215 if ( strlen($this->arrSql['htmlmail']) > 0 ) { 206 216 $this->setWhere( " mailmaga_flg = ? "); … … 212 222 213 223 // 購入金額指定 224 if (!isset($this->arrSql['buy_total_from'])) $this->arrSql['buy_total_from'] = ""; 225 if (!isset($this->arrSql['buy_total_to'])) $this->arrSql['buy_total_to'] = ""; 214 226 if( is_numeric( $this->arrSql["buy_total_from"] ) || is_numeric( $this->arrSql["buy_total_to"] ) ) { 215 227 $arrBuyTotal = $this->selectRange($this->arrSql["buy_total_from"], $this->arrSql["buy_total_to"], "buy_total"); … … 220 232 221 233 // 購入回数指定 234 if (!isset($this->arrSql['buy_times_from'])) $this->arrSql['buy_times_from'] = ""; 235 if (!isset($this->arrSql['buy_times_to'])) $this->arrSql['buy_times_to'] = ""; 222 236 if( is_numeric( $this->arrSql["buy_times_from"] ) || is_numeric( $this->arrSql["buy_times_to"] ) ) { 223 237 $arrBuyTimes = $this->selectRange($this->arrSql["buy_times_from"], $this->arrSql["buy_times_to"], "buy_times"); … … 228 242 229 243 // 誕生日期間指定 244 if (!isset($this->arrSql['b_start_year'])) $this->arrSql['b_start_year'] = ""; 245 if (!isset($this->arrSql['b_start_month'])) $this->arrSql['b_start_month'] = ""; 246 if (!isset($this->arrSql['b_start_day'])) $this->arrSql['b_start_day'] = ""; 247 if (!isset($this->arrSql['b_end_year'])) $this->arrSql['b_end_year'] = ""; 248 if (!isset($this->arrSql['b_end_month'])) $this->arrSql['b_end_month'] = ""; 249 if (!isset($this->arrSql['b_end_day'])) $this->arrSql['b_end_day'] = ""; 230 250 if ( (strlen($this->arrSql['b_start_year']) > 0 && strlen($this->arrSql['b_start_month']) > 0 && strlen($this->arrSql['b_start_day']) > 0) || 231 251 strlen($this->arrSql['b_end_year']) > 0 && strlen($this->arrSql['b_end_month']) > 0 && strlen($this->arrSql['b_end_day']) > 0) { … … 241 261 242 262 // 誕生月の検索 263 if (!isset($this->arrSql['birth_month'])) $this->arrSql['birth_month'] = ""; 243 264 if (is_numeric($this->arrSql["birth_month"])) { 244 265 $this->setWhere(" EXTRACT(month from birth) = ?"); … … 247 268 248 269 // 登録期間指定 270 if (!isset($this->arrSql['start_year'])) $this->arrSql['start_year'] = ""; 271 if (!isset($this->arrSql['start_month'])) $this->arrSql['start_month'] = ""; 272 if (!isset($this->arrSql['start_day'])) $this->arrSql['start_day'] = ""; 273 if (!isset($this->arrSql['end_year'])) $this->arrSql['end_year'] = ""; 274 if (!isset($this->arrSql['end_month'])) $this->arrSql['end_month'] = ""; 275 if (!isset($this->arrSql['end_day'])) $this->arrSql['end_day'] = ""; 249 276 if ( (strlen($this->arrSql['start_year']) > 0 && strlen($this->arrSql['start_month']) > 0 && strlen($this->arrSql['start_day']) > 0 ) || 250 277 (strlen($this->arrSql['end_year']) > 0 && strlen($this->arrSql['end_month']) >0 && strlen($this->arrSql['end_day']) > 0) ) { … … 260 287 261 288 // 最終購入日指定 289 if (!isset($this->arrSql['buy_start_year'])) $this->arrSql['buy_start_year'] = ""; 290 if (!isset($this->arrSql['buy_start_month'])) $this->arrSql['buy_start_month'] = ""; 291 if (!isset($this->arrSql['buy_start_day'])) $this->arrSql['buy_start_day'] = ""; 292 if (!isset($this->arrSql['buy_end_year'])) $this->arrSql['buy_end_year'] = ""; 293 if (!isset($this->arrSql['buy_end_month'])) $this->arrSql['buy_end_month'] = ""; 294 if (!isset($this->arrSql['buy_end_day'])) $this->arrSql['buy_end_day'] = ""; 295 262 296 if ( (strlen($this->arrSql['buy_start_year']) > 0 && strlen($this->arrSql['buy_start_month']) > 0 && strlen($this->arrSql['buy_start_day']) > 0 ) || 263 297 (strlen($this->arrSql['buy_end_year']) > 0 && strlen($this->arrSql['buy_end_month']) >0 && strlen($this->arrSql['buy_end_day']) > 0) ) { … … 272 306 273 307 //購入商品コード 308 if (!isset($this->arrSql['buy_product_code'])) $this->arrSql['buy_product_code'] = ""; 274 309 if ( strlen($this->arrSql['buy_product_code']) > 0 ) { 275 310 $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 ? ))"); … … 279 314 280 315 //購入商品名称 316 if (!isset($this->arrSql['buy_product_name'])) $this->arrSql['buy_product_name'] = ""; 281 317 if ( strlen($this->arrSql['buy_product_name']) > 0 ) { 282 318 $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 ? ))"); … … 286 322 287 323 //カテゴリーを選択している場合のみ絞込検索を行う 324 if (!isset($this->arrSql['category_id'])) $this->arrSql['category_id'] = ""; 288 325 if ( strlen($this->arrSql['category_id']) != ""){ 289 326 //カテゴリーで絞込検索を行うSQL文生成 290 list($tmp_where, $tmp_arrval) = sfGetCatWhere(sfManualEscape($this->arrSql['category_id']));327 list($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere(SC_Utils_Ex::sfManualEscape($this->arrSql['category_id'])); 291 328 292 329 //カテゴリーで絞込みが可能の場合
Note: See TracChangeset
for help on using the changeset viewer.