erp/app/Listeners/CreateLogisticListener.php

41 lines
899 B
PHP
Raw Normal View History

2023-08-28 13:42:27 +08:00
<?php
namespace App\Listeners;
use App\Events\CreateLogisticEvent;
2024-12-28 11:13:17 +08:00
use App\Models\BusinessOrder;
2023-08-28 13:42:27 +08:00
use App\Models\Shop;
use App\Services\Business\BusinessFactory;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class CreateLogisticListener implements ShouldQueue
{
public $connection = 'redis';
public $queue = 'listeners';
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
2024-12-28 11:13:17 +08:00
* @param CreateLogisticEvent $event
2023-08-28 13:42:27 +08:00
* @return void
*/
public function handle(CreateLogisticEvent $event)
{
2024-12-28 11:13:17 +08:00
$shop = Shop::query()->findOrFail($event->shopId);;
2023-08-28 13:42:27 +08:00
$client = BusinessFactory::init()->make($shop['plat_id'])->setShop($shop);
2024-12-28 11:13:17 +08:00
//$client->createLogistic($event->orderSn, $event->waybillNo);
2023-08-28 13:42:27 +08:00
}
}