first upload all files

This commit is contained in:
NW
2023-06-11 13:14:03 +01:00
parent f14dbc52b5
commit c08b36d1b6
1705 changed files with 106852 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace Modules\Report;
use Modules\Order\Entities\Order;
use Modules\Shipping\Facades\ShippingMethod;
class ShippingReport extends Report
{
protected function view()
{
return 'report::admin.reports.shipping_report.index';
}
protected function data()
{
return [
'shippingMethods' => ShippingMethod::all(),
];
}
public function query()
{
return Order::select('shipping_method')
->selectRaw('MIN(created_at) as start_date')
->selectRaw('MAX(created_at) as end_date')
->selectRaw('COUNT(*) as total_orders')
->selectRaw('SUM(shipping_cost) as total')
->when(request()->has('shipping_method'), function ($query) {
$query->where('shipping_method', request('shipping_method'));
})
->groupBy('shipping_method');
}
}