used qualifyColumn to prefix columns

This commit is contained in:
Denis Duliçi
2021-09-10 09:41:15 +03:00
parent f77b6475ff
commit 91907067a2
14 changed files with 50 additions and 50 deletions

View File

@ -78,17 +78,17 @@ class DocumentItem extends Model
public function scopeType(Builder $query, string $type)
{
return $query->where($this->table . '.type', '=', $type);
return $query->where($this->qualifyColumn('type'), '=', $type);
}
public function scopeInvoice(Builder $query)
{
return $query->where($this->table . '.type', '=', Document::INVOICE_TYPE);
return $query->where($this->qualifyColumn('type'), '=', Document::INVOICE_TYPE);
}
public function scopeBill(Builder $query)
{
return $query->where($this->table . '.type', '=', Document::BILL_TYPE);
return $query->where($this->qualifyColumn('type'), '=', Document::BILL_TYPE);
}
public function getDiscountAttribute(): string