fixed company list page sortable issue

This commit is contained in:
Cihan Şentürk 2024-05-21 23:22:49 +03:00 committed by GitHub
parent 6faeaf9227
commit 7c706392e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 0 deletions

View File

@ -442,6 +442,22 @@ class Company extends Eloquent implements Ownable
->select('companies.*');
}
/**
* Sort by company phone
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param $direction
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function phoneSortable($query, $direction)
{
return $query->join('settings', 'companies.id', '=', 'settings.company_id')
->where('key', 'company.phone')
->orderBy('value', $direction)
->select('companies.*');
}
/**
* Sort by company tax number
*