feat: 부대장 발령 시 부대장 대신 부대 이름 표기

This commit is contained in:
2022-07-10 20:50:33 +09:00
parent 93490276fd
commit 94bb96d208
4 changed files with 69 additions and 10 deletions
@@ -63,9 +63,9 @@ class GetReservedCommand extends \sammo\BaseAPI
$nationTurnList = [];
foreach ($db->queryAllLists(
'SELECT officer_level, turn_idx, action, arg, brief FROM nation_turn WHERE nation_id = %i ORDER BY officer_level DESC, turn_idx ASC',
$me['nation']
) as [$officer_level, $turn_idx, $action, $arg, $brief]) {
'SELECT officer_level, turn_idx, action, arg, brief FROM nation_turn WHERE nation_id = %i ORDER BY officer_level DESC, turn_idx ASC',
$me['nation']
) as [$officer_level, $turn_idx, $action, $arg, $brief]) {
if (!key_exists($officer_level, $nationTurnList)) {
$nationTurnList[$officer_level] = [];
}
@@ -76,6 +76,14 @@ class GetReservedCommand extends \sammo\BaseAPI
];
}
$troopList = [];
foreach ($db->queryAllLists(
'SELECT troop_leader, `name` FROM troop WHERE `nation` = %i',
$nationID
) as [$troopID, $troopName]) {
$troopList[$troopID] = $troopName;
}
$nationChiefList = [];
foreach ($nationTurnList as $officer_level => $turnBrief) {
@@ -111,7 +119,8 @@ class GetReservedCommand extends \sammo\BaseAPI
'turnTerm' => $turnTerm,
'date' => TimeUtil::now(true),
'chiefList' => $nationChiefList,
'isChief'=>($me['officer_level'] > 4),
'troopList' => $troopList,
'isChief' => ($me['officer_level'] > 4),
'autorun_limit' => $generalObj->getAuxVar('autorun_limit'),
'officerLevel' => $me['officer_level'],
'commandList' => getChiefCommandTable($generalObj),