Merge remote-tracking branch 'origin/php8' into php8

This commit is contained in:
xiaomlove
2022-12-19 19:01:31 +08:00
2 changed files with 5 additions and 1 deletions

View File

@@ -710,11 +710,13 @@ function get_row_count($table, $suffix = "")
function get_user_row($id)
{
global $Cache, $CURUSER;
static $userRows=[];
static $curuserRowUpdated = false;
static $neededColumns = array(
'id', 'noad', 'class', 'enabled', 'privacy', 'avatar', 'signature', 'uploaded', 'downloaded', 'last_access', 'username', 'donor',
'donoruntil', 'leechwarn', 'warned', 'title', 'downloadpos', 'parked', 'clientselect', 'showclienterror',
);
if(isset($userRows[$id]))return $userRows[$id];
$cacheKey = 'user_'.$id.'_content';
$row = \Nexus\Database\NexusDB::remember($cacheKey, 3600, function () use ($id, $neededColumns) {
$user = \App\Models\User::query()->with(['wearing_medals'])->find($id, $neededColumns);
@@ -751,7 +753,7 @@ function get_user_row($id)
if (!$row)
return false;
else return $row;
else return $userRows[$id]=$row;
}
function get_user_class()