fixes
This commit is contained in:
@@ -13,7 +13,7 @@ class TariffsDataTable extends DataTable
|
||||
|
||||
public function query(Tariff $model)
|
||||
{
|
||||
$model = $model->with(['sale_channel'])->select(['shop_tariffs.*']);
|
||||
$model = $model->with(['sale_channels'])->select(['shop_tariffs.*']);
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,14 @@ class TariffsDataTable extends DataTable
|
||||
->editColumn('status', function (Tariff $tariff) {
|
||||
return Tariffs::getStatus($tariff['status_id']);
|
||||
})
|
||||
->rawColumns(['action'])
|
||||
->editColumn('sale_channels2', function (Tariff $tariff) {
|
||||
$html = '';
|
||||
foreach ($tariff->sale_channels as $sale_channel) {
|
||||
$html .= $sale_channel->code . ', ';
|
||||
}
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['sale_channels2', 'action'])
|
||||
;
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
@@ -33,7 +40,7 @@ class TariffsDataTable extends DataTable
|
||||
return [
|
||||
Column::make('status_id')->data('status')->title('status'),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('sale_channel.name')->title('Canal de vente par défaut'),
|
||||
Column::make('sale_channels2')->title('Canaux de vente'),
|
||||
Column::make('code')->title('Code'),
|
||||
Column::make('ref')->title('Référence'),
|
||||
$this->makeColumnButtons(),
|
||||
|
||||
Reference in New Issue
Block a user