PublicRecord 함수 수정, json_encode, json_deocde를 Json로 통합

This commit is contained in:
2018-04-01 19:16:00 +09:00
parent 1f5f7e3591
commit 6ee8066c80
15 changed files with 47 additions and 38 deletions
+3 -3
View File
@@ -175,7 +175,7 @@ function getGeneralPublicRecordRecent($count) {
return join('<br>', $texts);
}
function getGeneralPublicRecordWithDate($count, $year, $month, $isFirst=0) {
function getGeneralPublicRecordWithDate($year, $month) {
$db = DB::db();
$texts = [];
@@ -225,10 +225,10 @@ function LogHistory($isFirst=0) {
$year = $map['year'];
$month = $map['month'];
$map_json = json_encode($map, JSON_UNESCAPED_UNICODE);
$map_json = Json::encode($map);
$log = getWorldHistoryWithDate($year, $month);
$genlog = getGeneralPublicRecordWithDate(50, $year, $month, $isFirst);
$genlog = getGeneralPublicRecordWithDate($year, $month);
$nationStr = "";
$powerStr = "";
+1 -1
View File
@@ -34,7 +34,7 @@ function getHistoryMap($year, $month){
return ['result'=>false, 'reason'=>'연감이 저장되지 않음'];
}
return json_decode($map, true);//까짓거 json_decode, json_encode 두번하지 뭐.
return Json::decode($map);//까짓거 json_decode, json_encode 두번하지 뭐.
}
/**
+4 -4
View File
@@ -130,7 +130,7 @@ function sendRawMessage($msgType, $isSender, $mailbox, $src, $dest, $msg, $date,
unset($msgOption['alert']);
}
DB::db()->insert('message', array(
DB::db()->insert('message', [
'address' => $dest,
'type' => $msgType,
'is_sender' => $isSender,
@@ -138,13 +138,13 @@ function sendRawMessage($msgType, $isSender, $mailbox, $src, $dest, $msg, $date,
'dest' => $dest['id'],
'time' => $date,
'valid_until' => $validUntil,
'message' => json_encode(Util::eraseNullValue([
'message' => Json::encode([
'src' => $src,
'dest' =>$dest,
'text' => $msg,
'option' => $msgOption
]))
));
], Json::DELETE_NULL)
]);
}
function sendMessage($msgType, $src, $dest, $msg, $date = null, $validUntil = null, $msgOption = null){
+3 -3
View File
@@ -62,13 +62,13 @@ if ($validUntil < $date) {
]);
}
$msgOption = json_decode(Util::array_get($messageInfo['option'], '{}'));
$msgOption = Json::decode(Util::array_get($messageInfo['option'], '{}'));
$msgAction = Util::array_get($msgOption['action'], null);
$messageInfo['option'] = $msgOption;
$msgSrc = json_decode($messageInfo['src']);
$msgSrc = Json::decode($messageInfo['src']);
$messageInfo['src'] = $msgSrc;
$msgDest = json_decode($messageInfo['dest']);
$msgDest = Json::decode($messageInfo['dest']);
$messageInfo['dest'] = $msgDest;
if (!$msgAction) {