This commit is contained in:
Ludovic CANDELLIER
2021-04-02 20:26:13 +02:00
parent e50bcffdd7
commit e6e86767d3
6 changed files with 8 additions and 82 deletions

View File

@@ -1,29 +0,0 @@
<?php
namespace App\Datatables\Shop;
use Yajra\DataTables\Html\Column;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Shop\ArticleAttributeFamily;
class ArticleAttributeFamiliesDataTable extends DataTable
{
public $model_name = 'ArticleAttributeFamilies';
public function query(ArticleAttributeFamily $model)
{
$model = $model::withCount(['values','articles']);
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('name')->title('Nom'),
Column::make('values_count')->title('Nb attributs')->searchable(false)->addClass('text-right'),
Column::make('articles_count')->title('Nb d\'articles')->searchable(false)->addClass('text-right'),
self::makeColumnButtons(),
];
}
}

View File

@@ -10,7 +10,7 @@ class PriceGenericCategoriesDataTable extends DataTable
{
public $model_name = 'price-generics';
public function query(PriceGeneric $model)
public function query(PriceGenericCategory $model)
{
return self::buildQuery($model);
}