55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
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 App\Models\Order;
|
|
|
|
class SendReserveNotice implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
protected $order;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct(Order $order)
|
|
{
|
|
//
|
|
$this->order = $order;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$temp_id = env('WECHAT_MINI_PROGRAM_TEMP_ID_RESERVE_ORDER_TIMEOUT', '9_CS5CY57mLMycOW8FRfHj-Dfda7q_BpY_OonrLTQqw');
|
|
$goods_list = $this->order->goods;
|
|
$msg_data = [
|
|
'number1' => [
|
|
'value'=> $this->order->order_sn,
|
|
],
|
|
'thing5' => [
|
|
'value'=> env('MEN_DIAN', '大坪天街时代店'),
|
|
],
|
|
'thing9' => [
|
|
'value'=> isset($goods_list[0]) ? $goods_list[0]->goods_name :'',
|
|
],
|
|
'time3' => [
|
|
'value'=>"您的预约订单未按时取餐,请尽快来取餐吧~点击查看详情",
|
|
],
|
|
];
|
|
$this->order->user->sendMiniprogramNotice($temp_id, 'pages/order-my/order-info?order_sn='.$this->order->order_sn, $msg_data);
|
|
}
|
|
} |