Files
opensem/app/Models/Shop/ArticleAttribute.php
2020-05-09 01:05:55 +02:00

28 lines
563 B
PHP

<?php
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
class ArticleAttribute extends Model
{
public function Price()
{
return $this->belongsTo('App\Models\Shop\ArticlePrice');
}
public function Value()
{
return $this->belongsTo('App\Models\Shop\ArticleAttribute');
}
public function scopeByPrice($query, $article_price_id)
{
return $query->where('article_price_id', $article_price_id);
}
public function scopeByAttribueValue($query, $article_value_id)
{
return $query->where('article_value_id', $article_value_id);
}
}