Extract.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\listener\user;
  12. use app\webscoket\SocketPush;
  13. use crmeb\interfaces\ListenerInterface;
  14. use app\services\system\admin\SystemAdminServices;
  15. /**
  16. * 用户申请提现事件
  17. * Class Recharge
  18. * @package app\listener\user
  19. */
  20. class Extract implements ListenerInterface
  21. {
  22. /**
  23. * 用户申请提现事件
  24. * @param $event
  25. */
  26. public function handle($event): void
  27. {
  28. [$user, $data, $res] = $event;
  29. try {
  30. SocketPush::admin()->type('WITHDRAW')->data(['id' => $res->id])->push();
  31. } catch (\Exception $e) {
  32. }
  33. /** @var SystemAdminServices $systemAdmin */
  34. $systemAdmin = app()->make(SystemAdminServices::class);
  35. $systemAdmin->adminNewPush();
  36. //提醒推送
  37. event('notice.notice', [['nickname' => $user['nickname'], 'money' => $data['money']], 'kefu_send_extract_application']);
  38. }
  39. }