You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?php
namespace App\Jobs;
use App\Common\OrderStatus;use App\Common\PayType;use App\Models\Order;use App\Service\SmsService;use App\Traits\SmsTraits;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;use Illuminate\Support\Facades\Log;
class BalanceDue implements ShouldQueue{ use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $orderNumber = ''; protected $redis=''; /** * Create a new job instance. * * @return void */ public function __construct($orderNumber,$delay) { $this->orderNumber = $orderNumber; $this->delay = $delay; }
/** * Execute the job. * * @return void */ public function handle() { $order = Order::query()->where('order_no',$this->orderNumber)->first(); if(env('SMS_SWITCH' , '') == true && !empty($order->status) && $order->status == OrderStatus::PAY_EARNEST){ $sms = new SmsService(); $type = $order->pay_type == PayType::DEPOSIT_PAY ? '订金' : '定金'; $sms->send('pay',['订单号:'.$this->orderNumber,$type,$order->timeout,$type,'小程序'],[$order->mobile]); } }}
|