{{-- ============================================================ resources/views/admin/purchases/index.blade.php ============================================================ --}} @extends('layouts.admin') @section('title','Point Purchases') @section('content') @php $totalRevenue = \App\Models\PointPurchase::where('status','completed')->sum('amount_ghs'); $pendingBank = \App\Models\PointPurchase::where('status','pending')->where('payment_method','bank')->count(); $totalPtsGiven = \App\Models\PointPurchase::where('status','completed')->sum('total_points'); $todayRevenue = \App\Models\PointPurchase::where('status','completed')->whereDate('paid_at',today())->sum('amount_ghs'); @endphp
| User | Points | Amount | Method | Reference | Status | Date | Actions |
|---|---|---|---|---|---|---|---|
|
{{ $p->user->name }} {{ $p->user->email }} |
{{ number_format($p->total_points) }}
@if($p->bonus_points > 0) +{{ number_format($p->bonus_points) }} bonus@endif |
GH₵{{ number_format($p->amount_ghs,2) }} | {{ $p->method_icon }} {{ $p->method_label }} | {{ Str::limit($p->payment_reference,20) }} | {{ ucfirst($p->status) }} | {{ $p->created_at->format('d M Y H:i') }} |
@if($p->status === 'pending' && $p->payment_method === 'bank')
@if($p->screenshot)
View Proof
@endif
@elseif($p->status === 'pending')
Auto-processing
@endif
{{ $p->depositor_name }}
@endif
{{ $p->bank_name }} |
| No purchases yet. | |||||||