init
This commit is contained in:
48
app/Jobs/CheckUser.php
Normal file
48
app/Jobs/CheckUser.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CheckUser implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected User $user;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$imParams = [
|
||||
'CheckItem' => [
|
||||
[
|
||||
'UserID' => (string) $this->user->id,
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
$vars = app('im')->send('im_open_login_svc', 'account_check', $imParams);
|
||||
$this->user->remember_token = $vars['ResultItem'][0]['AccountStatus'];
|
||||
$this->user->save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user