mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -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)
|
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) {
|
->whereHas('assetstatus', function ($query) {
|
||||||
$query->where(function ($query) {
|
$query->where(function ($query) {
|
||||||
$query->where('deployable', '=', 1)
|
$query->where('deployable', '=', 1)
|
||||||
|
|
Loading…
Reference in a new issue