diff --git a/backend/modules/gameplay/controllers/HintController.php b/backend/modules/gameplay/controllers/HintController.php index 0e287f6d2..004fb54a4 100644 --- a/backend/modules/gameplay/controllers/HintController.php +++ b/backend/modules/gameplay/controllers/HintController.php @@ -77,7 +77,18 @@ public function actionGive($id) // { // // fetch player_question // } - $db->createCommand('INSERT INTO player_hint (player_id, hint_id) SELECT id,:hint_id FROM player WHERE active=1 and `type`=:ptype ON DUPLICATE KEY UPDATE player_id=values(player_id)') + if($hint->player_type==='both') + { + foreach(['offense','defense'] as $val) + { + $db->createCommand('INSERT INTO player_hint (player_id, hint_id) SELECT id,:hint_id FROM player WHERE active=1 and `type`=:ptype ON DUPLICATE KEY UPDATE player_id=values(player_id)') + ->bindValue(':hint_id', $hint->id) + ->bindValue(':ptype', $val) + ->execute(); + } + } + else + $db->createCommand('INSERT INTO player_hint (player_id, hint_id) SELECT id,:hint_id FROM player WHERE active=1 and `type`=:ptype ON DUPLICATE KEY UPDATE player_id=values(player_id)') ->bindValue(':hint_id', $hint->id) ->bindValue(':ptype', $hint->player_type) ->execute();