ActivateLevel.php 1.3 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\jobs\activity\StoreCouponJob;
  13. use app\jobs\user\UserIntegralJob;
  14. use app\jobs\user\UserMoneyJob;
  15. use crmeb\interfaces\ListenerInterface;
  16. /**
  17. * 激活用户会员卡事件
  18. * Class ActivateLevel
  19. * @package app\listener\user
  20. */
  21. class ActivateLevel implements ListenerInterface
  22. {
  23. /**
  24. * @param $event
  25. * @return void
  26. */
  27. public function handle($event): void
  28. {
  29. [$uid] = $event;
  30. //会员卡激活赠送积分
  31. UserIntegralJob::dispatchDo('levelGiveIntegral', [$uid]);
  32. //会员卡激活赠送余额
  33. UserMoneyJob::dispatchDo('levelGiveMoney', [$uid]);
  34. //会员卡激活赠送优惠券
  35. StoreCouponJob::dispatchDo('levelGiveCoupon', [$uid]);
  36. }
  37. }