Recharge.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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\jobs\system\CapitalFlowJob;
  13. use crmeb\interfaces\ListenerInterface;
  14. /**
  15. * 用户充值事件
  16. * Class Recharge
  17. * @package app\listener\user
  18. */
  19. class Recharge implements ListenerInterface
  20. {
  21. /**
  22. * 用户充值事件
  23. * @param $event
  24. */
  25. public function handle($event): void
  26. {
  27. [$order, $now_money] = $event;
  28. //记录资金流水
  29. CapitalFlowJob::dispatch([$order, 'recharge']);
  30. //提醒推送
  31. event('notice.notice', [['order' => $order, 'now_money' => $now_money], 'recharge_success']);
  32. // 小程序订单服务
  33. event('order.routine.shipping', ['recharge', $order, 3, '', '']);
  34. }
  35. }