Fixes on unities, remove old code

This commit is contained in:
Ludovic CANDELLIER
2021-04-01 22:26:50 +02:00
parent a7881e4261
commit ce50d2da5e
26 changed files with 253 additions and 609 deletions

View File

@@ -13,9 +13,16 @@ class UnitiesDataTable extends DataTable
public function query(Unity $model)
{
$model = $model::with(['package.article_family'])->select('shop_unities.*');
$model = self::filterByFamily($model);
return self::buildQuery($model);
}
public static function filterByFamily($model, $family_id = false)
{
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
return $family_id ? $model->byArticleFamily($family_id) : $model;
}
protected function getColumns()
{
return [