improve Questtype ?submit? and store additional data for Character answers
This commit is contained in:
parent
9cdd0cf8e3
commit
95837803a1
14 changed files with 302 additions and 38 deletions
|
|
@ -406,6 +406,33 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the last status of a Quest for a Character.
|
||||
*
|
||||
* @param int $questId ID of Quest
|
||||
* @param int $characterId ID of Character to get status for
|
||||
* @return int Last status
|
||||
*/
|
||||
public function getLastQuestStatus($questId, $characterId)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT id, created, status '.
|
||||
'FROM quests_characters '.
|
||||
'WHERE quest_id = ? AND character_id = ? '.
|
||||
'ORDER BY created DESC '.
|
||||
'LIMIT 1',
|
||||
'ii',
|
||||
$questId, $characterId
|
||||
);
|
||||
if(!empty($data)) {
|
||||
return $data[0];
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Quest.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue