used qualifyColumn to prefix columns
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user