Changeset 16734
- Timestamp:
- 2007/11/07 17:51:51 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/beta/data/class/SC_SelectSql.php
r15120 r16734 73 73 //--¡¡´ü´Ö¸¡º÷¡Ê¡ûǯ¡û·î¡ûÆü¤«¢·¡ûǯ¡û·î¡ûÆü¤Þ¤Ç¡Ë 74 74 function selectTermRange($from_year, $from_month, $from_day, $to_year, $to_month, $to_day, $column) { 75 76 75 // FROM 77 $date1 = $from_year . "/" . $from_month . "/". $from_day;76 $date1 = $from_year. "/". $from_month. "/". $from_day; 78 77 79 78 // TO 80 $date2 = mktime (0, 0, 0, $to_month, $to_day, $to_year); 81 $date2 = $date2 + 86400; 82 // SQLʸ¤Îdate´Ø¿ô¤ËÍ¿¤¨¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢yyyy/mm/dd¤Ç»ØÄꤹ¤ë¡£ 83 $date2 = date('Y/m/d', $date2); 79 $to_day += 1; // °ìÆü¿Ê¤á¤ë 80 $date2 = $to_year. "/". $to_month . "/". $to_day; 84 81 85 82 // ³«»Ï´ü´Ö¤À¤±»ØÄê¤Î¾ì¹ç 86 if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && ( $to_year == "" ) && ( $to_month == "" ) && ( $to_day == "" ) ) { 87 $this->setWhere( $column ." >= '" . $date1 . "'"); 88 } 89 90 //¡¡³«»Ï¡Á½ªÎ» 91 if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && 92 ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) { 93 $this->setWhere( $column ." >= '" . $date1 ."' AND ". $column . " < date('" . $date2 . "')" ); 94 } 95 83 if (($from_year != "") && ($from_month != "") && ($from_day != "") && ($to_year == "") && ($to_month == "") && ($to_day == "")) { 84 $this->setWhere($column. " >= '". $date1. "'"); 85 } 86 87 // ³«»Ï¡Á½ªÎ» 88 if (($from_year != "") && ($from_month != "") && ($from_day != "") && ($to_year != "") && ($to_month != "") && ($to_day != "")) { 89 $this->setWhere($column ." >= '" . $date1 ."' AND ". $column . " < '" . $date2 . "'"); 90 } 91 96 92 // ½ªÎ»´ü´Ö¤À¤±»ØÄê¤Î¾ì¹ç 97 if( ( $from_year == "" ) && ( $from_month == "" ) && ( $from_day == "" ) && ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" )) {98 $this->setWhere( $column ." < date('" . $date2 . "')");93 if(($from_year == "") && ($from_month == "") && ($from_day == "") && ($to_year != "") && ($to_month != "") && ($to_day != "")) { 94 $this->setWhere($column ." < '" . $date2 . "'"); 99 95 } 100 96 return $return;
Note: See TracChangeset
for help on using the changeset viewer.