Mise à jour
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user