Answer the question
In order to leave comments, you need to log in
How to bind several variables for different databases in a common query?
Good afternoon everyone,
I have a task to make a report based on the selection of several attributes
. And it turns out that all of them are directly tied to one database, but among them there is a search by floors that I can’t bind to the program in any way
//index
$level = [2,3,4,5,6];
public function getReport(Request $request)
{
$start_date = $request->get('start_date', date('d.m.Y'));
$date_end = $request->get('date_end', date('d.m.Y'));
//$level_id = DB::select('select * from room where level_id = :level', ['level' > 1]);
$level_id = Room::where( 'level_id', '=', $request['level']+2)->select('number')->get();
$habitation = Habitation::with([ "places"])
->where('status','=','saselen')
->whereDate('dogovor_date','>=',$start_date)
->whereDate('dogovor_date','<=',$date_end)
->get();
return view('admin.admissionRep.report',compact('habitation', 'level_id', 'start_date','date_end'));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question