refactor, better class namespace intergration
This commit is contained in:
@@ -14,12 +14,12 @@ class ArticlePrice extends Model
|
||||
|
||||
public function price()
|
||||
{
|
||||
return $this->hasOne('App\Models\Price');
|
||||
return $this->hasOne(Price::class);
|
||||
}
|
||||
|
||||
public function article_family()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ArticleNature');
|
||||
return $this->belongsTo(ArticleNature::class);
|
||||
}
|
||||
|
||||
public function scopeByQuantity($query, $quantity)
|
||||
@@ -29,6 +29,6 @@ class ArticlePrice extends Model
|
||||
|
||||
public function scopeByFamily($query, $id)
|
||||
{
|
||||
return $query->where('article_family_value_id', $id);
|
||||
return $query->where($this->table . '.article_family_value_id', $id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user