comparison 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
comparison
equal deleted inserted replaced
95:d9b9d1d903a1 106:57676bb30f64
45 45
46 if( $this->weekofday != 7 ) { 46 if( $this->weekofday != 7 ) {
47 $options .= " AND WEEKDAY(starttime) = '".$this->weekofday."'"; 47 $options .= " AND WEEKDAY(starttime) = '".$this->weekofday."'";
48 } 48 }
49 49
50 if( $this->prgtime != 24 ) {
51 $options .= " AND time(starttime) BETWEEN cast('".sprintf( "%02d:00:00", $this->prgtime)."' as time) AND cast('".sprintf("%02d:59:59", $this->prgtime)."' as time)";
52 }
53
50 $options .= " ORDER BY starttime ASC"; 54 $options .= " ORDER BY starttime ASC";
51 55
52 $recs = array(); 56 $recs = array();
53 try { 57 try {
54 $recs = DBRecord::createRecords( PROGRAM_TBL, $options ); 58 $recs = DBRecord::createRecords( PROGRAM_TBL, $options );
55 } 59 }
56 catch( Exception $e ) { 60 catch( Exception $e ) {
57 throw $e; 61 throw $e;
58 } 62 }
59
60 return $recs; 63 return $recs;
61 } 64 }
62 65
63 66
64 public function reservation() { 67 public function reservation() {