Fix some enhancements & new features
This commit is contained in:
@@ -9,14 +9,24 @@ class ArticleAttributeValue extends Model
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_article_attribute_values';
|
||||
|
||||
public function ArticleAttributeFamily()
|
||||
public function article_attribute_family()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ArticleAttributeFamily');
|
||||
}
|
||||
|
||||
public function scopeByFamily($query, $attribute_family_id)
|
||||
public function attributes()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
|
||||
public function articles()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ArticleAttribute')->groupBy('article_id');
|
||||
}
|
||||
|
||||
public function scopeByFamily($query, $id)
|
||||
{
|
||||
return $query->where('article_attribute_family_id', $attribute_family_id);
|
||||
return $query->where('article_attribute_family_id', $id);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user