Changeset 21269
- Timestamp:
- 2011/10/02 04:22:08 (13 years ago)
- Location:
- branches/version-2_11-dev/data/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/class/SC_CustomerList.php
r21118 r21269 213 213 if( is_numeric( $this->arrSql["search_buy_total_from"] ) || is_numeric( $this->arrSql["search_buy_total_to"] ) ) { 214 214 $arrBuyTotal = $this->selectRange($this->arrSql["search_buy_total_from"], $this->arrSql["search_buy_total_to"], "buy_total"); 215 foreach ($arrBuyTotal as $data 1) {216 $this->arrVal[] = $data 1;215 foreach ($arrBuyTotal as $data) { 216 $this->arrVal[] = $data; 217 217 } 218 218 } … … 223 223 if( is_numeric( $this->arrSql["search_buy_times_from"] ) || is_numeric( $this->arrSql["search_buy_times_to"] ) ) { 224 224 $arrBuyTimes = $this->selectRange($this->arrSql["search_buy_times_from"], $this->arrSql["search_buy_times_to"], "buy_times"); 225 foreach ($arrBuyTimes as $data 2) {226 $this->arrVal[] = $data 2;225 foreach ($arrBuyTimes as $data) { 226 $this->arrVal[] = $data; 227 227 } 228 228 } … … 240 240 $arrBirth = $this->selectTermRange($this->arrSql['search_b_start_year'], $this->arrSql['search_b_start_month'], $this->arrSql['search_b_start_day'] 241 241 , $this->arrSql['search_b_end_year'], $this->arrSql['search_b_end_month'], $this->arrSql['search_b_end_day'], 'birth'); 242 if (is_array($arrBirth)) { 243 foreach ($arrBirth as $data3) { 244 $this->arrVal[] = $data3; 245 } 242 foreach ($arrBirth as $data) { 243 $this->arrVal[] = $data; 246 244 } 247 245 } … … 266 264 $arrRegistTime = $this->selectTermRange($this->arrSql['search_start_year'], $this->arrSql['search_start_month'], $this->arrSql['search_start_day'] 267 265 , $this->arrSql['search_end_year'], $this->arrSql['search_end_month'], $this->arrSql['search_end_day'], $regdate_col); 268 if (is_array($arrRegistTime)) { 269 foreach ($arrRegistTime as $data4) { 270 $this->arrVal[] = $data4; 271 } 266 foreach ($arrRegistTime as $data) { 267 $this->arrVal[] = $data; 272 268 } 273 269 } … … 285 281 $arrRegistTime = $this->selectTermRange($this->arrSql['search_buy_start_year'], $this->arrSql['search_buy_start_month'], $this->arrSql['search_buy_start_day'] 286 282 , $this->arrSql['search_buy_end_year'], $this->arrSql['search_buy_end_month'], $this->arrSql['search_buy_end_day'], "last_buy_date"); 287 if (is_array($arrRegistTime)) { 288 foreach ($arrRegistTime as $data4) { 289 $this->arrVal[] = $data4; 290 } 283 foreach ($arrRegistTime as $data) { 284 $this->arrVal[] = $data; 291 285 } 292 286 } -
branches/version-2_11-dev/data/class/SC_SelectSql.php
r20764 r21269 88 88 //-- 期間検索(○年○月○日か~○年○月○日まで) 89 89 function selectTermRange($from_year, $from_month, $from_day, $to_year, $to_month, $to_day, $column) { 90 $return = array(); 90 91 91 92 // 開始期間の構築 … … 102 103 // 開始期間だけ指定の場合 103 104 if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && ( $to_year == "" ) && ( $to_month == "" ) && ( $to_day == "" ) ) { 104 $this->setWhere( $column ." >= '" . $date1 . "'"); 105 $this->setWhere( $column .' >= ?'); 106 $return[] = $date1; 105 107 } 106 108 … … 108 110 if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && 109 111 ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) { 110 $this->setWhere( $column ." >= '" . $date1 ."' AND ". $column . " < date('" . $date2 . "')" ); 112 $this->setWhere( $column . ' >= ? AND ' . $column . ' < date(?)' ); 113 $return[] = $date1; 114 $return[] = $date2; 111 115 } 112 116 113 117 // 終了期間だけ指定の場合 114 118 if( ( $from_year == "" ) && ( $from_month == "" ) && ( $from_day == "" ) && ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) { 115 $this->setWhere( $column ." < date('" . $date2 . "')"); 116 } 119 $this->setWhere( $column . ' < date(?)'); 120 $return[] = $date2; 121 } 122 123 return $return; 117 124 } 118 125
Note: See TracChangeset
for help on using the changeset viewer.