mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Fixes constraint violation when ordering some columns
This commit is contained in:
parent
0a6626891e
commit
e0b64a4879
|
@ -1187,7 +1187,9 @@ class Asset extends Depreciable
|
|||
|
||||
public function scopeRequestableAssets($query)
|
||||
{
|
||||
return Company::scopeCompanyables($query->where('requestable', '=', 1))
|
||||
$table = $query->getModel()->getTable();
|
||||
|
||||
return Company::scopeCompanyables($query->where($table.'.requestable', '=', 1))
|
||||
->whereHas('assetstatus', function ($query) {
|
||||
$query->where(function ($query) {
|
||||
$query->where('deployable', '=', 1)
|
||||
|
|
Loading…
Reference in a new issue