m
This commit is contained in:
@@ -275,4 +275,15 @@ class UserService implements UserServiceInterface
|
||||
|
||||
$user->save();
|
||||
}
|
||||
|
||||
public function getSentCardsToUserThisMonth(User $sender, string $receiverMsnv): int
|
||||
{
|
||||
$startOfMonth = Carbon::now()->startOfMonth();
|
||||
$endOfMonth = Carbon::now()->endOfMonth();
|
||||
|
||||
return (int) Administration::where('msnv', $sender->msnv)
|
||||
->where('receiver', $receiverMsnv)
|
||||
->whereBetween('date', [$startOfMonth, $endOfMonth])
|
||||
->sum('sent');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user