admin/app/Jobs/WithdrawFreeAuditJob.php

50 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Created by PhpStorm.
*
* User: king/QQ995265288
* Date: 2018/6/15 下午2:33
* Email: livsyitian@163.com
*/
namespace app\Jobs;
use app\frontend\modules\withdraw\models\Withdraw;
use app\frontend\modules\withdraw\services\AutomateAuditService;
use app\host\HostManager;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class WithdrawFreeAuditJob implements ShouldQueue
{
use InteractsWithQueue, Queueable, SerializesModels;
/**
* @var Withdraw
*/
private $withdrawModel;
public function __construct(Withdraw $withdrawModel)
{
$hostCount = count((new HostManager())->hosts() ?: []) ? : 1;
$this->queue = 'limit:'.($withdrawModel->member_id % (3 * $hostCount));
$this->withdrawModel = $withdrawModel;
}
public function handle()
{
$automateAuditService = new AutomateAuditService($this->withdrawModel);
try {
$automateAuditService->freeAudit();
} catch (\Exception $e) {
\Log::debug('提现审核',[$e->getMessage()]);
}
}
}