feat(web/user/system_msg): unread msgs bg-warning
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-27 18:34:41 +08:00 committed by GitHub
parent 4868c7fdfc
commit 512185fc10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,10 +64,6 @@
$system_msgs[$idx]['delete_form'] = $delete_form; $system_msgs[$idx]['delete_form'] = $delete_form;
} }
} }
if (Auth::id() == $user['username']) {
DB::update("update user_system_msg set read_time = now() where receiver = '" . $user['username'] . "'");
}
?> ?>
<?php echoUOJPageHeader('系统消息') ?> <?php echoUOJPageHeader('系统消息') ?>
@ -83,7 +79,9 @@
<div class="card mb-3"> <div class="card mb-3">
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
<?php foreach ($system_msgs as $msg): ?> <?php foreach ($system_msgs as $msg): ?>
<li class="list-group-item"> <li class="list-group-item
<?= $msg['read_time'] ? '' : 'bg-warning bg-opacity-25' ?>
">
<div class="mb-2 d-flex justify-content-between"> <div class="mb-2 d-flex justify-content-between">
<div> <div>
<?php if ($msg['title']): ?> <?php if ($msg['title']): ?>
@ -113,6 +111,12 @@
<?= $pag->pagination() ?> <?= $pag->pagination() ?>
<?php
if (Auth::id() == $user['username']) {
DB::update("update user_system_msg set read_time = now() where receiver = '" . $user['username'] . "'");
}
?>
</div> </div>
<!-- end left col --> <!-- end left col -->