m
This commit is contained in:
@@ -193,10 +193,10 @@ class UserService implements UserServiceInterface
|
||||
$currentUserRankItem = $userItem;
|
||||
}
|
||||
|
||||
if ($index < 4) {
|
||||
$rankers[] = $userItem;
|
||||
}
|
||||
// Include every ranked user (no hard limit)
|
||||
$rankers[] = $userItem;
|
||||
$rank++;
|
||||
|
||||
}
|
||||
|
||||
if (!$currentUserRankItem) {
|
||||
@@ -214,6 +214,32 @@ class UserService implements UserServiceInterface
|
||||
];
|
||||
}
|
||||
|
||||
// Retrieve paginated list of received ThankCards for a user
|
||||
public function getReceivedPageData(User $user, string $selectedMonth): array
|
||||
{
|
||||
$start = Carbon::parse($selectedMonth)->startOfMonth();
|
||||
$end = Carbon::parse($selectedMonth)->endOfMonth();
|
||||
$cards = Administration::where('msnv', $user->msnv)
|
||||
->whereBetween('date', [$start, $end])
|
||||
->where('received', '>', 0)
|
||||
->orderBy('date', 'desc')
|
||||
->get();
|
||||
return ['cards' => $cards];
|
||||
}
|
||||
|
||||
// Retrieve paginated list of sent ThankCards for a user
|
||||
public function getSentPageData(User $user, string $selectedMonth): array
|
||||
{
|
||||
$start = Carbon::parse($selectedMonth)->startOfMonth();
|
||||
$end = Carbon::parse($selectedMonth)->endOfMonth();
|
||||
$cards = Administration::where('msnv', $user->msnv)
|
||||
->whereBetween('date', [$start, $end])
|
||||
->where('sent', '>', 0)
|
||||
->orderBy('date', 'desc')
|
||||
->get();
|
||||
return ['cards' => $cards];
|
||||
}
|
||||
|
||||
public function updateProfile(User $user, array $data, ?\Illuminate\Http\UploadedFile $avatarFile = null): void
|
||||
{
|
||||
if (isset($data['name'])) {
|
||||
|
||||
Reference in New Issue
Block a user