1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Jobs;
- use App\DataApiNew\Models\OrderSettRecord;
- use App\DataApiNew\Helper\OrdersHelper;
- use Illuminate\Bus\Queueable;
- use Illuminate\Queue\SerializesModels;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Support\Facades\Log;
- class AutoSettleJob implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- public $recordId;
- public $type;
- public function __construct($recordId, $type)
- {
- $this->recordId = $recordId;
- $this->type = $type;
- }
- public function handle()
- {
- try {
- if ($this->type == 1) {
- // 号卡
- (new OrdersHelper())->batchOrderSettle($this->recordId);
- }
- } catch (\Exception $e) {
- Log::error('自动批量结算异常:' . $e);
- }
- }
- }
|