mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
change torrent pos_state to varchar, support more sticky level
This commit is contained in:
@@ -27,6 +27,20 @@ class Torrent extends NexusModel
|
||||
'basic_source', 'basic_standard', 'basic_team',
|
||||
];
|
||||
|
||||
const POS_STATE_STICKY_NONE = 'normal';
|
||||
const POS_STATE_STICKY_ONE = 'sticky';
|
||||
/**
|
||||
* alphabet 'r' is after 'n' and before 's', so it will fit: order by pos_state desc,
|
||||
* first sticky, then r_sticky, then normal
|
||||
*/
|
||||
const POS_STATE_STICKY_SECOND = 'r_sticky';
|
||||
|
||||
public static $posStates = [
|
||||
self::POS_STATE_STICKY_NONE => ['text' => 'Normal', 'icon_counts' => 0],
|
||||
self::POS_STATE_STICKY_SECOND => ['text' => 'Sticky second level', 'icon_counts' => 1],
|
||||
self::POS_STATE_STICKY_ONE => ['text' => 'Sticky top level', 'icon_counts' => 2],
|
||||
];
|
||||
|
||||
public static function getBasicInfo(): array
|
||||
{
|
||||
$result = [];
|
||||
@@ -36,6 +50,15 @@ class Torrent extends NexusModel
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function listPosStates(): array
|
||||
{
|
||||
$result = self::$posStates;
|
||||
foreach ($result as $key => &$value) {
|
||||
$value['text'] = nexus_trans('torrent.pos_state_' . $key);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getFieldLabels(): array
|
||||
{
|
||||
$fields = ['comments', 'times_completed', 'peers_count', 'thank_users_count', 'numfiles'];
|
||||
|
||||
Reference in New Issue
Block a user