mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Fixed #4613 - Added table prefix to user search DB raw
This commit is contained in:
parent
f90271dae5
commit
5ee6e7f94b
|
@ -13,6 +13,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use App\Http\Traits\UniqueUndeletedTrait;
|
use App\Http\Traits\UniqueUndeletedTrait;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Laravel\Passport\HasApiTokens;
|
use Laravel\Passport\HasApiTokens;
|
||||||
|
use DB;
|
||||||
|
|
||||||
class User extends SnipeModel implements AuthenticatableContract, CanResetPasswordContract
|
class User extends SnipeModel implements AuthenticatableContract, CanResetPasswordContract
|
||||||
{
|
{
|
||||||
|
@ -441,7 +442,7 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
|
||||||
|
|
||||||
//Ugly, ugly code because Laravel sucks at self-joins
|
//Ugly, ugly code because Laravel sucks at self-joins
|
||||||
->orWhere(function ($query) use ($search) {
|
->orWhere(function ($query) use ($search) {
|
||||||
$query->whereRaw("users.manager_id IN (select id from users where first_name LIKE ? OR last_name LIKE ?)", ["%$search%", "%$search%"]);
|
$query->whereRaw(DB::getTablePrefix()."users.manager_id IN (select id from ".DB::getTablePrefix()."users where first_name LIKE ? OR last_name LIKE ?)", ["%$search%", "%$search%"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue