mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Fixed - missing table prefix for location parent search
This commit is contained in:
parent
b560828173
commit
1e8c32fbdb
|
@ -9,6 +9,7 @@ use App\Presenters\Presentable;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
use DB;
|
||||
|
||||
class Location extends SnipeModel
|
||||
{
|
||||
|
@ -184,7 +185,7 @@ class Location extends SnipeModel
|
|||
})
|
||||
// Ugly, ugly code because Laravel sucks at self-joins
|
||||
->orWhere(function ($query) use ($search) {
|
||||
$query->whereRaw("parent_id IN (select id from locations where name LIKE '%".$search."%') ");
|
||||
$query->whereRaw("parent_id IN (select id from ".DB::getTablePrefix()."locations where name LIKE '%".$search."%') ");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue