erp/app/Listeners/SendDatabaseNotification.php

36 lines
650 B
PHP
Raw Normal View History

2022-08-08 10:43:59 +08:00
<?php
namespace App\Listeners;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use App\Events\BusinessOrdersUpdate;
2022-08-08 10:43:59 +08:00
class SendDatabaseNotification implements ShouldQueue
2022-08-08 10:43:59 +08:00
{
use InteractsWithQueue;
2022-08-08 10:43:59 +08:00
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param BusinessOrdersUpdate $event
2022-08-08 10:43:59 +08:00
* @return void
*/
public function handle(BusinessOrdersUpdate $event)
2022-08-08 10:43:59 +08:00
{
if (5 >= $event->goodsSku->stock) {
// 发送通知给管理员
}
2022-08-08 10:43:59 +08:00
}
}