implement managing of Character groups Quests
This commit is contained in:
parent
b9305b077f
commit
63ee9a9468
9 changed files with 283 additions and 73 deletions
|
|
@ -200,7 +200,8 @@
|
|||
return $this->db->query(
|
||||
'SELECT id, name, url, xps, motto, seminaryupload_id '.
|
||||
'FROM v_charactergroups '.
|
||||
'WHERE charactergroupsgroup_id = ?',
|
||||
'WHERE charactergroupsgroup_id = ? '.
|
||||
'ORDER BY name',
|
||||
'i',
|
||||
$groupsgroupId
|
||||
);
|
||||
|
|
@ -278,6 +279,33 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the Character groups for a Quest.
|
||||
*
|
||||
* @param int $questId ID of the Character groups Quest
|
||||
* @return array Character groups
|
||||
*/
|
||||
public function getGroupsForQuest($questId)
|
||||
{
|
||||
$groups = $this->db->query(
|
||||
'SELECT charactergroups.id, charactergroups.name, charactergroups.url, charactergroupsquests_groups.created, charactergroupsquests_groups.xps_factor, charactergroupsquests.xps '.
|
||||
'FROM charactergroupsquests_groups '.
|
||||
'LEFT JOIN charactergroups ON charactergroups.id = charactergroupsquests_groups.charactergroup_id '.
|
||||
'LEFT JOIN charactergroupsquests ON charactergroupsquests.id = charactergroupsquests_groups.charactergroupsquest_id '.
|
||||
'WHERE charactergroupsquests_groups.charactergroupsquest_id = ? '.
|
||||
'ORDER BY xps_factor DESC',
|
||||
'i',
|
||||
$questId
|
||||
);
|
||||
foreach($groups as &$group) {
|
||||
$group['xps'] = round($group['xps'] * $group['xps_factor'], 1);
|
||||
}
|
||||
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a Character group name already exists.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue