mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fix user command fields
This commit is contained in:
+1
-1
@@ -222,7 +222,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
|||||||
'id', 'username', 'email', 'class', 'status', 'added', 'avatar',
|
'id', 'username', 'email', 'class', 'status', 'added', 'avatar',
|
||||||
'uploaded', 'downloaded', 'seedbonus', 'seedtime', 'leechtime',
|
'uploaded', 'downloaded', 'seedbonus', 'seedtime', 'leechtime',
|
||||||
'invited_by', 'enabled', 'seed_points', 'last_access', 'invites',
|
'invited_by', 'enabled', 'seed_points', 'last_access', 'invites',
|
||||||
'lang', 'attendance_card', 'privacy', 'noad', 'downloadpos', 'donoruntil', 'donor', 'language'
|
'lang', 'attendance_card', 'privacy', 'noad', 'downloadpos', 'donoruntil', 'donor',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function getDefaultUserAttributes(): array
|
public static function getDefaultUserAttributes(): array
|
||||||
|
|||||||
@@ -687,4 +687,28 @@ HTML;
|
|||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function removeDuplicateSnatch()
|
||||||
|
{
|
||||||
|
$size = 2000;
|
||||||
|
$stickyPromotionExists = NexusDB::hasTable('');
|
||||||
|
while (true) {
|
||||||
|
$snatchRes = NexusDB::select("select userid, torrentid, group_concat(id) as ids from snatched group by userid, torrentid having(count(*)) > 1 limit $size");
|
||||||
|
if (empty($snatchRes)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
do_log("[DELETE_DUPLICATED_SNATCH], count: " . count($snatchRes));
|
||||||
|
foreach ($snatchRes as $snatchRow) {
|
||||||
|
$torrentId = $snatchRow['torrentid'];
|
||||||
|
$userId = $snatchRow['userid'];
|
||||||
|
$idArr = explode(',', $snatchRow['ids']);
|
||||||
|
sort($idArr, SORT_NUMERIC);
|
||||||
|
$remainId = array_pop($idArr);
|
||||||
|
$delIdStr = implode(',', $idArr);
|
||||||
|
do_log("[DELETE_DUPLICATED_SNATCH], torrent: $torrentId, user: $userId, snatchIdStr: $delIdStr");
|
||||||
|
NexusDB::statement("delete from snatched where id in ($delIdStr)");
|
||||||
|
NexusDB::statement("update claims set snatched_id = $remainId where torrent_id = $torrentId and uid = $userId");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-01-31');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-02-01');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
@@ -482,4 +482,6 @@ class Update extends Install
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user