I have given a check which decides whether the request is accepted or rejected. I have given a condition which decides whether an action has taken placed or not, and according to that action it displays Yes or No. But the problem when I give the check accepted every record shows accepted and when I give the check rejected every record shows rejected
@if($joins->leave_status != "Pending")
Yes
@else
No
@endif
This is the join from where I am getting leave_status
$join = DB::table('leaves_policy')
->join('leaves_policies', 'leaves_policy.leave_policy', '=', 'leaves_policies.title')
->join('leaves_requests', 'leaves_policy.requested_by' , '=', 'leaves_requests.requested_by')
->select('leaves_policy.*', 'leaves_policies.title', 'leaves_policies.total_no_of_leaves_allowed_per_year',
'leaves_policies.no_of_months_leaves_valid', 'leaves_policies.max_leaves_per_month', 'leaves_policies.max_con_leaves_per_month',
'leaves_requests.leave_status','leaves_requests.accepted_by','leaves_requests.rejected_by')
->groupBy('leaves_policy.id')
->get();
Aucun commentaire:
Enregistrer un commentaire