mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
improve paid torrent + hit and run
This commit is contained in:
30
app/Jobs/UpdateUserDownloadPrivilege.php
Normal file
30
app/Jobs/UpdateUserDownloadPrivilege.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Repositories\UserRepository;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
|
||||
class UpdateUserDownloadPrivilege implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct(public int $userId, public string $status, public string $reasonKey)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$rep = new UserRepository();
|
||||
$rep->updateDownloadPrivileges(null, $this->userId, $this->status, $this->reasonKey);
|
||||
do_log("Updating user download privilege for user {$this->userId} to {$this->status} by reason {$this->reasonKey}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user