fix orders datatables on profile, fix deliveries for profile (public & active)

This commit is contained in:
Ludovic CANDELLIER
2023-08-29 22:15:37 +02:00
parent 043b7d7215
commit 01f9c9ae7c
10 changed files with 60 additions and 91 deletions

View File

@@ -18,10 +18,16 @@ class CustomerOrdersDataTable extends DataTable
public $stateSave = true;
public function __construct()
{
$this->url = route('Shop.Orders.index');
}
public function query(Order $model)
{
$customer_id = Auth::id();
$model = $model->byCustomer($customer_id)->with(['delivery']);
$customerId = Auth::id();
$model = $model->byCustomer($customerId)->with(['delivery']);
return $this->buildQuery($model);
}
@@ -46,8 +52,8 @@ class CustomerOrdersDataTable extends DataTable
protected function getColumns()
{
return [
Column::make('ref')->title('Ref'),
Column::make('status')->title('Statut'),
Column::make('ref')->title('Ref'),
Column::make('created_at')->title('Date'),
Column::make('payment_type')->title('Règlement'),
Column::make('total_shipped')->title('Montant')->class('text-right'),