mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -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 Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Passport\HasApiTokens;
|
||||
use DB;
|
||||
|
||||
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
|
||||
->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