feat: new feature

This commit is contained in:
JaguarJack
2022-12-23 19:47:13 +08:00
parent 17f2dc4d3c
commit 81fac9f62c
38 changed files with 1019 additions and 1486 deletions

View File

@@ -24,14 +24,15 @@ class LogLogin extends Model
/**
*
* @param string $email
* @param ?string $email
* @return LengthAwarePaginator
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function getUserLogBy(string $email): LengthAwarePaginator
public function getUserLogBy(?string $email): LengthAwarePaginator
{
return self::query()->where('account', $email)
->paginate(request()->get('limit', 10));
return static::when($email, function ($query) use ($email){
$query->where('account', $email);
})->paginate(request()->get('limit', 10));
}
}