2022-08-08 10:43:59 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Listeners;
|
|
|
|
|
|
|
|
|
|
use App\Models\Shop;
|
|
|
|
|
use Illuminate\Auth\Events\Registered;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
|
|
2022-08-10 16:39:25 +08:00
|
|
|
class UpdateBusinessGoodsStock implements ShouldQueue
|
2022-08-08 10:43:59 +08:00
|
|
|
{
|
2022-08-10 16:39:25 +08:00
|
|
|
protected $shopId;
|
|
|
|
|
protected $updateOrders;
|
2022-08-08 10:43:59 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create the event listener.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2022-08-10 16:39:25 +08:00
|
|
|
public function __construct($shopId, $updateOrders)
|
2022-08-08 10:43:59 +08:00
|
|
|
{
|
2022-08-10 16:39:25 +08:00
|
|
|
$this->shopId = $shopId;
|
|
|
|
|
$this->updateOrders = $updateOrders;
|
2022-08-08 10:43:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handle the event.
|
|
|
|
|
*
|
2022-08-10 16:39:25 +08:00
|
|
|
* @param Registered $event
|
2022-08-08 10:43:59 +08:00
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function handle(Registered $event)
|
|
|
|
|
{
|
2022-08-10 16:39:25 +08:00
|
|
|
if (empty($this->updateOrders)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-08-08 10:43:59 +08:00
|
|
|
}
|
|
|
|
|
}
|