mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
paid torrent
This commit is contained in:
@@ -35,8 +35,10 @@ class BonusLogs extends NexusModel
|
||||
const BUSINESS_TYPE_BUY_RAINBOW_ID = 16;
|
||||
const BUSINESS_TYPE_BUY_CHANGE_USERNAME_CARD = 17;
|
||||
const BUSINESS_TYPE_GIFT_MEDAL = 18;
|
||||
const BUSINESS_TYPE_BUY_TORRENT = 19;
|
||||
|
||||
const BUSINESS_TYPE_ROLE_WORK_SALARY = 1000;
|
||||
const BUSINESS_TYPE_TORRENT_BE_DOWNLOADED = 1001;
|
||||
|
||||
public static array $businessTypes = [
|
||||
self::BUSINESS_TYPE_CANCEL_HIT_AND_RUN => ['text' => 'Cancel H&R'],
|
||||
@@ -57,8 +59,10 @@ class BonusLogs extends NexusModel
|
||||
self::BUSINESS_TYPE_BUY_RAINBOW_ID => ['text' => 'Buy rainbow ID'],
|
||||
self::BUSINESS_TYPE_BUY_CHANGE_USERNAME_CARD => ['text' => 'Buy change username card'],
|
||||
self::BUSINESS_TYPE_GIFT_MEDAL => ['text' => 'Gift medal to someone'],
|
||||
self::BUSINESS_TYPE_BUY_TORRENT => ['text' => 'Buy torrent'],
|
||||
|
||||
self::BUSINESS_TYPE_ROLE_WORK_SALARY => ['text' => 'Role work salary'],
|
||||
self::BUSINESS_TYPE_TORRENT_BE_DOWNLOADED => ['text' => 'Torrent be downloaded'],
|
||||
];
|
||||
|
||||
public function getBusinessTypeTextAttribute()
|
||||
|
||||
@@ -14,7 +14,7 @@ class Torrent extends NexusModel
|
||||
'size', 'added', 'type', 'numfiles', 'owner', 'nfo', 'sp_state', 'promotion_time_type',
|
||||
'promotion_until', 'anonymous', 'url', 'pos_state', 'cache_stamp', 'picktype', 'picktime',
|
||||
'last_reseed', 'pt_gen', 'technical_info', 'leechers', 'seeders', 'cover', 'last_action',
|
||||
'times_completed', 'approval_status', 'banned', 'visible', 'pos_state_until',
|
||||
'times_completed', 'approval_status', 'banned', 'visible', 'pos_state_until', 'price',
|
||||
];
|
||||
|
||||
const VISIBLE_YES = 'yes';
|
||||
@@ -33,7 +33,7 @@ class Torrent extends NexusModel
|
||||
public static $commentFields = [
|
||||
'id', 'name', 'added', 'visible', 'banned', 'owner', 'sp_state', 'pos_state', 'hr', 'picktype', 'picktime',
|
||||
'last_action', 'leechers', 'seeders', 'times_completed', 'views', 'size', 'cover', 'anonymous', 'approval_status',
|
||||
'pos_state_until', 'category', 'source', 'medium', 'codec', 'standard', 'processing', 'team', 'audiocodec',
|
||||
'pos_state_until', 'category', 'source', 'medium', 'codec', 'standard', 'processing', 'team', 'audiocodec', 'price'
|
||||
];
|
||||
|
||||
public static $basicRelations = [
|
||||
@@ -240,7 +240,7 @@ class Torrent extends NexusModel
|
||||
|
||||
public static function getFieldsForList($appendTableName = false): array|bool
|
||||
{
|
||||
$fields = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr, approval_status, cover';
|
||||
$fields = 'id, sp_state, promotion_time_type, promotion_until, banned, picktype, pos_state, category, source, medium, codec, standard, processing, team, audiocodec, leechers, seeders, name, small_descr, times_completed, size, added, comments,anonymous,owner,url,cache_stamp, pt_gen, hr, approval_status, cover, price';
|
||||
$fields = preg_split('/[,\s]+/', $fields);
|
||||
if ($appendTableName) {
|
||||
foreach ($fields as &$value) {
|
||||
|
||||
23
app/Models/TorrentBuyLog.php
Normal file
23
app/Models/TorrentBuyLog.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class TorrentBuyLog extends NexusModel
|
||||
{
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = ['uid', 'torrent_id', 'price', 'channel'];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'uid');
|
||||
}
|
||||
|
||||
public function torrent()
|
||||
{
|
||||
return $this->belongsTo(Torrent::class, 'torrent_id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user