1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Jobs;
- use App\Models\DepositOrder;
- use Carbon\Carbon;
- use Illuminate\Database\Eloquent\Model;
- class CloseOrderJob extends Job
- {
- protected $model = '';
-
- public function __construct(Model $model, Carbon $delay)
- {
- $this->model = $model;
-
- $this->delay($delay);
- }
-
- public function handle()
- {
- if ((int)$this->model->pay_status === DepositOrder::PAY_STATUS_OK) {
- return;
- }
- $this->model->delete();
- }
- }
|