30 lines
668 B
PHP
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));
|
|
}
|
|
}
|
|
}
|