Skip to content

Commit

Permalink
remind mail check input_status from status
Browse files Browse the repository at this point in the history
  • Loading branch information
tyoshii committed Oct 3, 2014
1 parent 9bfa336 commit 378cdaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions fuel/app/classes/model/game.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public static function get_incomplete_gameids($player_id)
}

// 野手成績の入力が完了しているかどうか
if ( Model_Stats_Hitting::get_status($game_id, $player_id) === '0' )
if (Model_Stats_Hitting::get_input_status($game_id, $player_id) !== 'complete')
{
$alert_games[] = array('kind' => 'batter') + $data;
continue;
Expand All @@ -370,7 +370,7 @@ public static function get_incomplete_gameids($player_id)
// 投手成績のアラート
if ( strstr($data['position'], '1') )
{
if ( Model_Stats_Pitching::get_status($game_id, $player_id) === '0' )
if (Model_Stats_Pitching::get_input_status($game_id, $player_id) !== 'complete')
{
$alert_games[] = array('kind' => 'pitcher') + $data;
continue;
Expand Down Expand Up @@ -398,15 +398,15 @@ public static function remind_mail( $game_id, $team_id )
}

// statusをチェックして、未完了であればメール送信
if ( Model_Stats_Hitting::get_status($game_id, $player_id) === '0' )
if (Model_Stats_Hitting::get_input_status($game_id, $player_id) !== 'complete')
{
$paths[] = "game/{$game_id}/batter/{$team_id}";
}

// 投手成績のアラート
if ( in_array('1', $player['position'] ) )
{
if ( Model_Stats_Pitching::get_status($game_id, $player_id) === '0' )
if (Model_Stats_Pitching::get_input_status($game_id, $player_id) !== 'complete')
{
$paths[] = "game/{$game_id}/pitcher/{$team_id}";
}
Expand Down
4 changes: 2 additions & 2 deletions fuel/app/classes/model/stats/hitting.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ public static function regist($ids, $datas, $status = null)
}
}

public static function get_status($game_id, $player_id)
public static function get_input_status($game_id, $player_id)
{
$s = self::query()->where(array(
'game_id' => $game_id,
'player_id' => $player_id,
))->get_one();

return $s ? $s->status : '0';
return $s ? $s->input_status : '';
}
}
4 changes: 2 additions & 2 deletions fuel/app/classes/model/stats/pitching.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ public static function regist($ids, $stats, $status = null)
}
}

public static function get_status($game_id, $player_id)
public static function get_input_status($game_id, $player_id)
{
$s = self::query()->where(array(
'game_id' => $game_id,
'player_id' => $player_id,
))->get_one();

return $s ? $s->status : '0';
return $s ? $s->input_status : '';
}
}

0 comments on commit 378cdaa

Please sign in to comment.