fix del new message count cache key

This commit is contained in:
xiaomlove
2022-06-16 02:40:36 +08:00
parent 990b8ab406
commit 0cf56968ea
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -69,6 +69,6 @@ class TorrentOperationLog extends NexusModel
'added' => now(),
];
Message::query()->insert($message);
NexusDB::cache_del("user_{$receiver->id}_inbox_count");
NexusDB::cache_del("user_{$receiver->id}_unread_message_count");
}
}
+2 -2
View File
@@ -200,7 +200,7 @@ $descriptionArr = format_description($descr);
$cover = get_image_from_description($descriptionArr, true, false);
$updateset[] = "cover = " . sqlesc($cover);
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
$affectedRows = sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
$dateTimeStringNow = date("Y-m-d H:i:s");
@@ -251,7 +251,7 @@ else
$searchRep = new \App\Repositories\SearchRepository();
$searchRep->updateTorrent($id);
if ($row['banned'] == 'yes' && $row['owner'] == $CURUSER['id']) {
if ($affectedRows == 1 && $row['banned'] == 'yes' && $row['owner'] == $CURUSER['id']) {
$torrentUrl = sprintf('%s/details.php?id=%s', getSchemeAndHttpHost(), $row['id']);
\App\Models\StaffMessage::query()->insert([
'sender' => $CURUSER['id'],