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

@ -262,17 +262,17 @@ class User extends Authenticatable implements HasLocalePreference
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)