How to get the item inside table particular column
How to get the item inside table particular column
i have this attendance table how do i get the status is equal to [A and P] only
here is my controller;
$atnds = DB::table('attendances')
->select(DB::raw('count(*) as total, status'))
->where(['status' => ['P','A']])
->whereBetween('days', [$from,$to])
->groupBy('status')
->where('lead_id', '=', $id)
->get();
1 Answer
1
If you want to add a condition to check wheather A
or P
is marked then use whereIn
A
P
whereIn
->whereIn('status', ['P','A'])
I Guess people would be either A
Absent or P
Present, not both.
A
P
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.