Files
opensem/app/Models/Shop/ArticleAttribute.php
2020-06-15 00:17:15 +02:00

31 lines
657 B
PHP

<?php
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
class ArticleAttribute extends Model
{
protected $guarded = ['id'];
protected $table = 'shop_article_attribute_attributes';
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);
}
}