TeamProfitCreatedEvent.php 856 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Module\Team\Events;
  3. use App\Module\Team\Models\TeamProfit;
  4. use Illuminate\Broadcasting\InteractsWithSockets;
  5. use Illuminate\Foundation\Events\Dispatchable;
  6. use Illuminate\Queue\SerializesModels;
  7. /**
  8. * 团队收益创建事件
  9. *
  10. * 当团队收益记录被创建时触发此事件。
  11. * 监听此事件可以执行如下操作:
  12. * 1. 发送通知
  13. * 2. 记录收益日志
  14. * 3. 更新用户的收益统计
  15. */
  16. class TeamProfitCreatedEvent
  17. {
  18. use Dispatchable, InteractsWithSockets, SerializesModels;
  19. /**
  20. * 团队收益模型
  21. *
  22. * @var TeamProfit
  23. */
  24. public $profit;
  25. /**
  26. * 创建一个新的事件实例
  27. *
  28. * @param TeamProfit $profit 团队收益模型
  29. * @return void
  30. */
  31. public function __construct(TeamProfit $profit)
  32. {
  33. $this->profit = $profit;
  34. }
  35. }