I am writing a sql query to fetch all the data for current year but condition is i want to get status - Pending data first and Approved and Rejected data. I am new to laravel. According to 'status' = Pending/Approve and Reject?
Can anyone help me out yr. Thanks in advanced.
$leaves = Leave::whereRaw('YEAR(start_date) = YEAR(CURDATE()) AND YEAR(end_date)=YEAR(CURDATE())')
->where('created_by', '=', \Auth::user()->creatorId())->get();
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/9jrLBkb
via IFTTT
Aucun commentaire:
Enregistrer un commentaire