feat: 국방 설정 시, 작성자와 작성 일시를 기록
This commit is contained in:
+2
-2
@@ -906,7 +906,7 @@ function nationMsg(General $general)
|
|||||||
$nationID = $general->getNationID();
|
$nationID = $general->getNationID();
|
||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
|
|
||||||
return $nationStor->notice ?? '';
|
return $nationStor->nationNotice['msg'] ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function banner()
|
function banner()
|
||||||
@@ -1812,7 +1812,7 @@ function deleteNation(General $lord, bool $applyDB): array
|
|||||||
|
|
||||||
$nation['generals'] = array_keys($nationGeneralList);
|
$nation['generals'] = array_keys($nationGeneralList);
|
||||||
$nation['aux'] = Json::decode($nation['aux']);
|
$nation['aux'] = Json::decode($nation['aux']);
|
||||||
$nation['msg'] = $nationStor->notice;
|
$nation['msg'] = $nationStor->nationNotice['msg'] ?? '';
|
||||||
$nation['scout_msg'] = $nationStor->scout_msg;
|
$nation['scout_msg'] = $nationStor->scout_msg;
|
||||||
$nation['aux'] += $nationStor->max_power;
|
$nation['aux'] += $nationStor->max_power;
|
||||||
$nation['history'] = getNationHistoryLogAll($nationID);
|
$nation['history'] = getNationHistoryLogAll($nationID);
|
||||||
|
|||||||
@@ -1142,7 +1142,7 @@ function checkEmperior()
|
|||||||
$nation = $nation;
|
$nation = $nation;
|
||||||
$nation['generals'] = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
|
$nation['generals'] = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
|
||||||
$nation['aux'] = Json::decode($nation['aux']);
|
$nation['aux'] = Json::decode($nation['aux']);
|
||||||
$nation['msg'] = $nationStor->notice;
|
$nation['msg'] = $nationStor->nationNotice['msg'] ?? '';;
|
||||||
$nation['scout_msg'] = $nationStor->scout_msg;
|
$nation['scout_msg'] = $nationStor->scout_msg;
|
||||||
$nation['aux'] += $nationStor->max_power;
|
$nation['aux'] += $nationStor->max_power;
|
||||||
$nation['history'] = getNationHistoryLogAll($nation['nation']);
|
$nation['history'] = getNationHistoryLogAll($nation['nation']);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use sammo\Session;
|
|||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use sammo\DB;
|
use sammo\DB;
|
||||||
use sammo\KVStorage;
|
use sammo\KVStorage;
|
||||||
|
use sammo\TimeUtil;
|
||||||
use sammo\Validator;
|
use sammo\Validator;
|
||||||
use sammo\WebUtil;
|
use sammo\WebUtil;
|
||||||
|
|
||||||
@@ -36,7 +37,7 @@ class SetNotice extends \sammo\BaseAPI
|
|||||||
$msg = $this->args['msg'];
|
$msg = $this->args['msg'];
|
||||||
$userID = $session->userID;
|
$userID = $session->userID;
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$me = $db->queryFirstRow('SELECT `no`,nation,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID);
|
$me = $db->queryFirstRow('SELECT `no`,`name`,nation,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID);
|
||||||
|
|
||||||
$permission = checkSecretPermission($me, false);
|
$permission = checkSecretPermission($me, false);
|
||||||
if($permission < 0){
|
if($permission < 0){
|
||||||
@@ -49,7 +50,12 @@ class SetNotice extends \sammo\BaseAPI
|
|||||||
$nationID = $me['nation'];
|
$nationID = $me['nation'];
|
||||||
|
|
||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
$nationStor->notice = WebUtil::htmlPurify($msg);
|
$nationStor->nationNotice = [
|
||||||
|
'date'=>TimeUtil::now(),
|
||||||
|
'msg'=>WebUtil::htmlPurify($msg),
|
||||||
|
'author'=>$me['name'],
|
||||||
|
'authorID'=>$me['no'],
|
||||||
|
];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'result' => true
|
'result' => true
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ $outcome = getOutcome(100, $dedicationList);
|
|||||||
<?= WebUtil::printStaticValues([
|
<?= WebUtil::printStaticValues([
|
||||||
'staticValues' => [
|
'staticValues' => [
|
||||||
'editable' => ($me['officer_level'] >= 5 || $permission == 4),
|
'editable' => ($me['officer_level'] >= 5 || $permission == 4),
|
||||||
'nationMsg' => $nationStor->notice ?? '',
|
'nationMsg' => $nationStor->nationNotice['msg'] ?? '',
|
||||||
'scoutMsg' => $nationStor->scout_msg ?? '',
|
'scoutMsg' => $nationStor->scout_msg ?? '',
|
||||||
'nationID' => $nationID,
|
'nationID' => $nationID,
|
||||||
'officerLevel' => $me['officer_level'],
|
'officerLevel' => $me['officer_level'],
|
||||||
|
|||||||
Reference in New Issue
Block a user