feature: form edit

This commit is contained in:
antv
2026-07-10 08:16:20 +07:00
parent 326e1f1028
commit a1ad7e738b
14 changed files with 509 additions and 165 deletions
+11 -4
View File
@@ -219,11 +219,18 @@ class AdminService implements AdminServiceInterface
return User::where('msnv', $msnv)->firstOrFail();
}
public function getAddCardsHistory(string $buyerMsnv): \Illuminate\Database\Eloquent\Collection
public function getAddCardsHistory(string $buyerMsnv, ?string $selectedMonth = null): \Illuminate\Database\Eloquent\Collection
{
return AddCard::with('sellerUser')
->where('buyer', $buyerMsnv)
->orderBy('date', 'desc')
$query = AddCard::with('sellerUser')
->where('buyer', $buyerMsnv);
if ($selectedMonth) {
$startOfMonth = Carbon::parse($selectedMonth)->startOfMonth()->format('Y-m-d');
$endOfMonth = Carbon::parse($selectedMonth)->endOfMonth()->format('Y-m-d');
$query->whereBetween('date', [$startOfMonth, $endOfMonth]);
}
return $query->orderBy('date', 'desc')
->orderBy('id', 'desc')
->get();
}