Add new version in repository

This commit is contained in:
Ludovic CANDELLIER
2021-07-25 23:19:27 +02:00
parent f75632b054
commit b879f11c99
608 changed files with 12235 additions and 7513 deletions

View File

@@ -7,28 +7,28 @@ use Znck\Eloquent\Traits\BelongsToThrough;
class ArticlePrice extends Model
{
use BelongsToThrough;
use BelongsToThrough;
protected $guarded = ['id'];
protected $table = 'shop_article_prices';
protected $guarded = ['id'];
protected $table = 'shop_article_prices';
public function price()
{
return $this->hasOne('App\Models\Price');
}
public function price()
{
return $this->hasOne('App\Models\Price');
}
public function article_family()
{
return $this->belongsTo('App\Models\ArticleFamily');
}
public function article_family()
{
return $this->belongsTo('App\Models\ArticleNature');
}
public function scopeByQuantity($query, $quantity)
{
return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first();
}
public function scopeByQuantity($query, $quantity)
{
return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first();
}
public function scopeByFamily($query, $id)
public function scopeByFamily($query, $id)
{
return $query->where('article_family_value_id', $id);
}
}
}
}