# HG changeset patch # User Sushi-k # Date 1267519350 -32400 # Node ID f6b909678e51bcc3b0b158aa03e502a51f8c2390 # Parent c29d41d0c945313e4e85ff06ff3dbda2fd453bb2 fix: CSとBSを合計するとチューナー数以上の重複予約が出来てしまうバグを修正 diff -r c29d41d0c945 -r f6b909678e51 Reservation.class.php --- a/Reservation.class.php Mon Mar 01 17:46:03 2010 +0900 +++ b/Reservation.class.php Tue Mar 02 17:42:30 2010 +0900 @@ -78,8 +78,10 @@ // √篋膣 = TUNER $tuners = ($crec->type == "GR") ? $settings->gr_tuners : $settings->bs_tuners; + $type_str = ($crec->type == "GR") ? "type = 'GR' " : "(type = 'BS' OR type = 'CS') "; + $battings = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND starttime < '".toDatetime($end_time) ."' ". "AND endtime > '".toDatetime($rec_start)."'" ); @@ -90,11 +92,11 @@ // 茹f純茲茯帥鴻 // 緇篋膣 $nexts = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND starttime = '".toDatetime($end_time - $settings->former_time)."'"); $prevs = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND endtime = '".$starttime."'" ); // 緇綣ャ若惹違遺札筝茲茹f∞ @@ -111,7 +113,7 @@ // 翫牙私膣荀篁 $trecs = DBRecord::createRecords(RESERVE_TBL, "WHERE complete = '0' ". - "AND type = '".$crec->type."' ". + "AND ".$type_str. "AND endtime = '".$starttime."'" ); // 翫腟 for( $i = 0; $i < count($trecs) ; $i++ ) { @@ -182,7 +184,7 @@ %TITLE% 腟帥ゃ %ST% 紮ユ鐚ex.200907201830) %ET% 腟篋ユ - %TYPE% GR/BS + %TYPE% GR/BS/CS %CH% c潟 %DOW% ワSun-Mon鐚 %DOWJ% ワ-鐚