add bulk confirm

This commit is contained in:
xiaomlove
2022-09-12 22:41:45 +08:00
parent e5cb98cf35
commit 480ed17b03
5 changed files with 38 additions and 3 deletions

View File

@@ -483,4 +483,18 @@ class UserRepository extends BaseRepository
return $result;
}
public function confirmUser($id): bool
{
$update = [
'status' => User::STATUS_CONFIRMED,
'editsecret' => '',
];
User::query()
->whereIn('id', Arr::wrap($id))
->where('status', User::STATUS_PENDING)
->update($update);
return true;
}
}