add user meta check deadline

This commit is contained in:
xiaomlove
2023-01-06 20:19:21 +08:00
parent 8d8e3b7768
commit ad6e66ce56
9 changed files with 22 additions and 1 deletions

View File

@@ -504,6 +504,9 @@ class UserRepository extends BaseRepository
$log .= ", meta exists";
$keyExistsUpdates['updated_at'] = now();
if (!empty($keyExistsUpdates['duration'])) {
if ($metaExists->deadline === null) {
throw new \RuntimeException(nexus_trans('user.metas.already_valid_forever', ['meta_key_text' => $metaExists->metaKeyText]));
}
$log .= ", has duration: {$keyExistsUpdates['duration']}";
if ($metaExists->deadline && $metaExists->deadline->gte(now())) {
$log .= ", not expire";