Changeset 21269 for branches/version-2_11-dev/data/class/SC_SelectSql.php
- Timestamp:
- 2011/10/02 04:22:08 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.