temp invite

This commit is contained in:
lgb
2024-02-26 23:44:17 +08:00
parent 9c07206c21
commit 79fe56967a
+4 -2
View File
@@ -64,6 +64,8 @@ class GenerateTemporaryInvite implements ShouldQueue
return; return;
} }
$idArr = explode(",", $idStr); $idArr = explode(",", $idStr);
$now = Carbon::now();
$expiredAt = Carbon::now()->addDays($this->days);
foreach ($idArr as $uid) { foreach ($idArr as $uid) {
try { try {
$hashArr = $toolRep->generateUniqueInviteHash([], $this->count, $this->count); $hashArr = $toolRep->generateUniqueInviteHash([], $this->count, $this->count);
@@ -74,8 +76,8 @@ class GenerateTemporaryInvite implements ShouldQueue
'invitee' => '', 'invitee' => '',
'hash' => $hash, 'hash' => $hash,
'valid' => 0, 'valid' => 0,
'expired_at' => Carbon::now()->addDays($this->days), 'expired_at' => $expiredAt,
'created_at' => Carbon::now(), 'created_at' => $now,
]; ];
} }
if (!empty($data)) { if (!empty($data)) {