Laravel Vapor - New UI for admin to download reports (sync code from Shipping Portal)

This commit is contained in:
Dillon Ngo
2024-10-12 16:58:38 +08:00
parent e9fa9fe592
commit c6329c2a42
3 changed files with 4 additions and 4 deletions
@@ -52,7 +52,7 @@ class ExportsAnalyticBookingTransactions implements FromQuery, WithHeadings, Wit
*/
public function query()
{
return Booking::query()->whereBetween('created_at', [Carbon::now()->subMonths(1), Carbon::now()]); //Limit, 'expensive' query;
return Booking::query()->whereBetween('created_at', [Carbon::now()->subMonths(2), Carbon::now()]); //Limit, 'expensive' query;
}
/**
@@ -27,7 +27,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping, Sho
*/
public function query()
{
return Transaction::whereBetween('created_at', [Carbon::now()->subMonths(2), Carbon::now()]) //Limit, 'expensive' query;
return Transaction::whereBetween('created_at', [Carbon::now()->subMonths(1), Carbon::now()]) //Limit, 'expensive' query;
->whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL])
->where('owner_type', '!=',Wallet::class);
}
@@ -25,7 +25,7 @@
<div class="card-body d-flex justify-content-between align-items-center">
<div>
<span>transactions.csv</span>
<p class="text-muted mb-0">(last 2 months)</p>
<p class="text-muted mb-0">(last 1 months)</p>
</div>
<open-link-in-new-tab-component custom-class="btn btn-primary" :url="route('transactions.export')">
<i class="fa fa-download"></i> Download
@@ -40,7 +40,7 @@
<div class="card-body d-flex justify-content-between align-items-center">
<div>
<span>bookingData.csv</span>
<p class="text-muted mb-0">(last 1 month)</p>
<p class="text-muted mb-0">(last 2 month)</p>
</div>
<open-link-in-new-tab-component custom-class="btn btn-primary" :url="route('bookingData.export')">
<i class="fa fa-download"></i> Download