feat: 감찰부

This commit is contained in:
2022-07-16 15:35:12 +09:00
parent 52164f8da7
commit 6fd7c11ee5
10 changed files with 231 additions and 94 deletions
+6 -5
View File
@@ -14,6 +14,7 @@ use function sammo\getBattleResultRecent;
use function sammo\getGeneralActionLogMore;
use function sammo\getGeneralActionLogRecent;
use function sammo\getGeneralHistoryLogAll;
use function sammo\getGeneralHistoryLogWithLogID;
class GetGeneralLog extends \sammo\BaseAPI
{
@@ -28,13 +29,13 @@ class GetGeneralLog extends \sammo\BaseAPI
$v
->rule('required', [
'generalID',
'type',
'reqType',
])
->rule('integer', [
'generalID',
'reqTo',
])
->rule('in', 'type', [
->rule('in', 'reqType', [
self::GENERAL_HISTORY,
self::GENERAL_ACTION,
self::BATTLE_RESULT,
@@ -76,7 +77,7 @@ class GetGeneralLog extends \sammo\BaseAPI
return '같은 나라의 장수가 아닙니다.';
}
$reqType = $this->args['type'];
$reqType = $this->args['reqType'];
if (
$reqType === self::GENERAL_ACTION &&
$testGeneralNPCType < 2 &&
@@ -103,7 +104,7 @@ class GetGeneralLog extends \sammo\BaseAPI
$userID = $session->userID;
$targetGeneralID = $this->getTargetGeneralID($session);
$reqType = $this->args['type'];
$reqType = $this->args['reqType'];
$reqTo = $this->args['reqTo'] ?? null;
$db = DB::db();
@@ -124,7 +125,7 @@ class GetGeneralLog extends \sammo\BaseAPI
'result' => true,
'reqType' => $reqType,
'generalID' => $targetGeneralID,
'log' => getGeneralHistoryLogAll($targetGeneralID)
'log' => getGeneralHistoryLogWithLogID($targetGeneralID)
];
}