| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace App\Module\UrsPromotion\Events;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * URS用户进入农场事件
- *
- * 当URS用户首次进入农场时触发,用于处理相关的业务逻辑
- * 如推荐奖励补发、统计更新等
- */
- class UrsUserEnteredFarmEvent
- {
- use Dispatchable, SerializesModels;
- /**
- * URS用户ID
- *
- * @var int
- */
- public int $ursUserId;
- /**
- * 农场用户ID
- *
- * @var int
- */
- public int $farmUserId;
- /**
- * 用户凭证(userKey)
- *
- * @var string|null
- */
- public ?string $userKey;
- /**
- * 是否为首次进入农场
- *
- * @var bool
- */
- public bool $isFirstEntry;
- /**
- * 进入农场的时间
- *
- * @var \Carbon\Carbon
- */
- public \Carbon\Carbon $entryTime;
- /**
- * 创建事件实例
- *
- * @param int $ursUserId URS用户ID
- * @param int $farmUserId 农场用户ID
- * @param string|null $userKey 用户凭证
- * @param bool $isFirstEntry 是否为首次进入农场
- */
- public function __construct(int $ursUserId, int $farmUserId, ?string $userKey = null, bool $isFirstEntry = true)
- {
- $this->ursUserId = $ursUserId;
- $this->farmUserId = $farmUserId;
- $this->userKey = $userKey;
- $this->isFirstEntry = $isFirstEntry;
- $this->entryTime = now();
- }
- }
|