diff --git a/app/Models/WebSocketDialog.php b/app/Models/WebSocketDialog.php index 8efa24a66..58996344c 100644 --- a/app/Models/WebSocketDialog.php +++ b/app/Models/WebSocketDialog.php @@ -155,7 +155,7 @@ class WebSocketDialog extends AbstractModel if (isset($this->search_msg_id)) { // 最后消息 (搜索预览消息) $this->last_msg = WebSocketDialogMsg::whereDialogId($this->id)->find($this->search_msg_id); - $this->last_at = $this->last_msg?->created_at; + $this->last_at = $this->last_msg ? Carbon::parse($this->last_msg->created_at)->format('Y-m-d H:i:s') : null; } else { // 未读信息 if (Base::judgeClientVersion("0.34.0")) { diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index 27f39198e..ad09b38db 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -102,8 +102,7 @@ import {MarkdownPreview} from "../store/markdown"; */ formatTime(date) { let now = $A.Time(), - time = $A.Date(date, true), - string = ''; + time = $A.Date(date, true); if ($A.formatDate('Ymd', now) === $A.formatDate('Ymd', time)) { return $A.formatDate('H:i', time) } @@ -113,7 +112,7 @@ import {MarkdownPreview} from "../store/markdown"; if ($A.formatDate('Y', now) === $A.formatDate('Y', time)) { return $A.formatDate('m-d', time) } - return $A.formatDate('Y-m-d', time); + return $A.formatDate('Y-m-d', time) || ''; }, /**