I need to search up a person based on their last name and partner last name. I need it to search input on both database columns.
The columns are
$users = Users::where(function($q) use($request) {
$q->where('sp1LName', $request->lastName)
->orWhere('sp2LName', $request->lastName);
})->where(function($x) use($request){
$x->where('sp1LName', $request->partnerLastName)
->orWhere('sp2LName', $request->partnerLastName);
})->where('signUpDate', Carbon::parse($request->date)->format('Y-m-d'))
->get();
select * from `users` where (`sp1LName` = ? or `sp2LName` = ?) and (`sp1LName` = ? or `sp2LName` = ?) and `signUpDate` = ? and `users`.`deleted_at
I keep on getting 0 results found when I input this.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire