used qualifyColumn to prefix columns
This commit is contained in:
@ -557,17 +557,17 @@ class Company extends Eloquent implements Ownable
|
||||
|
||||
public function scopeSource($query, $source)
|
||||
{
|
||||
return $query->where($this->table . '.created_from', $source);
|
||||
return $query->where($this->qualifyColumn('created_from'), $source);
|
||||
}
|
||||
|
||||
public function scopeIsOwner($query)
|
||||
{
|
||||
return $query->where($this->table . '.created_by', user_id());
|
||||
return $query->where($this->qualifyColumn('created_by'), user_id());
|
||||
}
|
||||
|
||||
public function scopeIsNotOwner($query)
|
||||
{
|
||||
return $query->where($this->table . '.created_by', '<>', user_id());
|
||||
return $query->where($this->qualifyColumn('created_by'), '<>', user_id());
|
||||
}
|
||||
|
||||
public function ownerKey($owner)
|
||||
|
@ -133,7 +133,7 @@ class Contact extends Model
|
||||
return $query;
|
||||
}
|
||||
|
||||
return $query->whereIn($this->table . '.type', (array) $types);
|
||||
return $query->whereIn($this->qualifyColumn('type'), (array) $types);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +144,7 @@ class Contact extends Model
|
||||
*/
|
||||
public function scopeVendor($query)
|
||||
{
|
||||
return $query->whereIn($this->table . '.type', (array) $this->getVendorTypes());
|
||||
return $query->whereIn($this->qualifyColumn('type'), (array) $this->getVendorTypes());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,7 +155,7 @@ class Contact extends Model
|
||||
*/
|
||||
public function scopeCustomer($query)
|
||||
{
|
||||
return $query->whereIn($this->table . '.type', (array) $this->getCustomerTypes());
|
||||
return $query->whereIn($this->qualifyColumn('type'), (array) $this->getCustomerTypes());
|
||||
}
|
||||
|
||||
public function scopeEmail($query, $email)
|
||||
|
Reference in New Issue
Block a user