| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Module\Farm\Events;
- use App\Module\Farm\Models\FarmHarvestLog;
- use App\Module\Farm\Models\FarmTeamProfit;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * 团队收益创建事件
- *
- * 当团队成员收获作物产生团队收益时触发
- */
- class TeamProfitCreatedEvent
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- /**
- * 获得收益的用户ID
- *
- * @var int
- */
- public $userId;
- /**
- * 团队成员ID
- *
- * @var int
- */
- public $teamMemberId;
- /**
- * 收获记录
- *
- * @var FarmHarvestLog
- */
- public $harvestLog;
- /**
- * 团队收益记录
- *
- * @var FarmTeamProfit
- */
- public $teamProfit;
- /**
- * 创建一个新的事件实例
- *
- * @param int $userId
- * @param int $teamMemberId
- * @param FarmHarvestLog $harvestLog
- * @param FarmTeamProfit $teamProfit
- * @return void
- */
- public function __construct(
- int $userId,
- int $teamMemberId,
- FarmHarvestLog $harvestLog,
- FarmTeamProfit $teamProfit
- ) {
- $this->userId = $userId;
- $this->teamMemberId = $teamMemberId;
- $this->harvestLog = $harvestLog;
- $this->teamProfit = $teamProfit;
- }
- }
|