temporary invite

This commit is contained in:
xiaomlove
2022-12-13 13:51:39 +08:00
parent 6fa604ce56
commit f413c61901
42 changed files with 727 additions and 47 deletions
@@ -0,0 +1,39 @@
<?php
namespace App\Console\Commands;
use App\Jobs\GenerateTemporaryInvite;
use Illuminate\Console\Command;
class InviteAddTemporary extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'invite:tmp {uid} {days} {count}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Add temporary invite to user, argument: uid(Multiple comma separated), days, count';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$uid = $this->argument('uid');
$days = $this->argument('days');
$count = $this->argument('count');
$this->info("uid: $uid, days: $days, count: $count");
$uidArr = preg_split('/[\s,]+/', $uid);
GenerateTemporaryInvite::dispatch($uidArr, $days, $count);
return Command::SUCCESS;
}
}
+4 -4
View File
@@ -12,6 +12,7 @@ use App\Models\Exam;
use App\Models\ExamProgress;
use App\Models\ExamUser;
use App\Models\HitAndRun;
use App\Models\Invite;
use App\Models\Medal;
use App\Models\Peer;
use App\Models\SearchBox;
@@ -94,10 +95,9 @@ class Test extends Command
*/
public function handle()
{
$rep = new WorkRepository();
$rep->settleRole(4);
$uid = "2,3,4";
$uidArr = preg_split('/[\s,]+/', $uid);
dd($uidArr);
}
}