Mise à jour

This commit is contained in:
Ludovic CANDELLIER
2021-03-21 23:26:53 +01:00
parent c025dbb385
commit 083d358fbd
78 changed files with 1003 additions and 716 deletions

View File

@@ -22,9 +22,14 @@ class Price extends Model
return $this->belongsTo('App\Models\Shop\PriceFamily');
}
public function price()
public function generic()
{
return $this->morphTo();
return $this->belongsTo('App\Models\Shop\PriceGeneric', 'price_generic_id');
}
public function generic_prices()
{
}
public function scopeByArticle($query, $id)
@@ -37,4 +42,14 @@ class Price extends Model
return $query->where('price_family_id', $id);
}
public function scopeGeneric($query)
{
return $query->whereNotNull('price_generic_id');
}
public function scopeNotGeneric($query)
{
return $query->whereNull('price_generic_id');
}
}