46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
class AdBackActivation implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
protected $back_log;
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($back_log)
|
|
{
|
|
$this->back_log = $back_log;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$back_log = $this->back_log;
|
|
$client = new \GuzzleHttp\Client();
|
|
if ($back_log && empty($back_log->status)) {
|
|
//回调积分墙
|
|
$ClientInfo = $client->request('GET', $back_log->callback);
|
|
$arr = json_decode($ClientInfo->getBody()->getContents(), true);
|
|
if (is_array($arr) && $arr['status']) {//激活成功
|
|
$back_log->status = 1;
|
|
$back_log->save();
|
|
}
|
|
}
|
|
}
|
|
}
|