diff Keyword.class.php @ 106:57676bb30f64

add: 時間帯で絞り込みを追加
author Sushi-k <epgrec@park.mda.or.jp>
date Mon, 08 Mar 2010 18:07:19 +0900
parents cb7da56c4198
children 7a64d5e3baee
line wrap: on
line diff
--- a/Keyword.class.php	Wed Mar 03 00:02:15 2010 +0900
+++ b/Keyword.class.php	Mon Mar 08 18:07:19 2010 +0900
@@ -47,6 +47,10 @@
 			$options .= " AND WEEKDAY(starttime) = '".$this->weekofday."'";
 		}
 		
+		if( $this->prgtime != 24 ) {
+			$options .= " AND time(starttime) BETWEEN cast('".sprintf( "%02d:00:00", $this->prgtime)."' as time) AND cast('".sprintf("%02d:59:59", $this->prgtime)."' as time)";
+		}
+		
 		$options .= " ORDER BY starttime ASC";
 		
 		$recs = array();
@@ -56,7 +60,6 @@
 		catch( Exception $e ) {
 			throw $e;
 		}
-		
 		return $recs;
 	}