Add new version in repository
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user