fixed company list page sortable issue
This commit is contained in:
parent
6faeaf9227
commit
7c706392e1
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue