0
0
Files
Babyclass/app/Listeners/WithdrawListener.php
2020-08-04 10:09:42 +08:00

30 lines
668 B
PHP

<?php
namespace App\Listeners;
use App\Events\WithdrawCompleted;
use App\Models\Param;
use App\Notifications\WithdrawCompleted as WithdrawCompletedNotifications;
use Illuminate\Contracts\Queue\ShouldQueue;
class WithdrawListener implements ShouldQueue
{
public $queue = 'LISTENER';
/**
* Handle the event.
*
* @param OrderPaidEvent $event
* @return void
*/
public function handle(WithdrawCompleted $event)
{
$withdraw = $event->withdraw;
if ($withdraw->user && $withdraw->user->openid) {
\Notification::send($withdraw->user, new WithdrawCompletedNotifications($withdraw));
}
}
}