mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-22 10:57:27 +08:00
exam add index SEED_POINTS + UPLOAD_TORRENT_COUNT
This commit is contained in:
+5
-1
@@ -36,12 +36,16 @@ class Exam extends NexusModel
|
||||
const INDEX_SEED_TIME_AVERAGE = 2;
|
||||
const INDEX_DOWNLOADED = 3;
|
||||
const INDEX_SEED_BONUS = 4;
|
||||
const INDEX_SEED_POINTS = 5;
|
||||
const INDEX_UPLOAD_TORRENT_COUNT = 6;
|
||||
|
||||
public static $indexes = [
|
||||
public static array $indexes = [
|
||||
self::INDEX_UPLOADED => ['name' => 'Uploaded', 'unit' => 'GB', 'source_user_field' => 'uploaded'],
|
||||
self::INDEX_DOWNLOADED => ['name' => 'Downloaded', 'unit' => 'GB', 'source_user_field' => 'downloaded'],
|
||||
self::INDEX_SEED_TIME_AVERAGE => ['name' => 'Seed time average', 'unit' => 'Hour', 'source_user_field' => 'seedtime'],
|
||||
self::INDEX_SEED_BONUS => ['name' => 'Bonus', 'unit' => '', 'source_user_field' => 'seedbonus'],
|
||||
self::INDEX_SEED_POINTS => ['name' => 'Seed points', 'unit' => '', 'source_user_field' => ''],
|
||||
self::INDEX_UPLOAD_TORRENT_COUNT => ['name' => 'Upload torrent', 'unit' => '', 'source_user_field' => ''],
|
||||
];
|
||||
|
||||
const FILTER_USER_CLASS = 'classes';
|
||||
|
||||
@@ -488,6 +488,11 @@ class Torrent extends NexusModel
|
||||
$query->where('visible', $visible);
|
||||
}
|
||||
|
||||
public function scopeNormal($query)
|
||||
{
|
||||
$query->where('visible', self::VISIBLE_YES)->where('banned', self::BANNED_NO);
|
||||
}
|
||||
|
||||
public function torrent_tags(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentTag::class, 'torrent_id');
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
'uploaded', 'downloaded', 'seedbonus', 'seedtime', 'leechtime',
|
||||
'invited_by', 'enabled', 'seed_points', 'last_access', 'invites',
|
||||
'lang', 'attendance_card', 'privacy', 'noad', 'downloadpos', 'donoruntil', 'donor',
|
||||
'seedbonus', 'bonuscomment', 'downloadpos', 'vip_added', 'vip_until', 'title', 'invites', 'attendance_card',
|
||||
'bonuscomment', 'downloadpos', 'vip_added', 'vip_until', 'title', 'invites', 'attendance_card',
|
||||
'seed_points_per_hour'
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user