belongsTo('App\Models\Shop\ArticlePrice','article_price_id'); } public function Value() { return $this->belongsTo('App\Models\Shop\ArticleAttributeValue','attribute_value_id'); } 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); } }