merge
This commit is contained in:
@@ -17,10 +17,20 @@ class LivechatController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$startDate = '2023-01-01';
|
||||
$endDate = '2023-08-01';
|
||||
$livechat = Livechat::with('doctor.user', 'doctor.speciality', 'appointment.appointmentDetail', 'healthCare')
|
||||
->where('nIDAppointment', '!=', null)->where('nIDAppointment', '!=', '')
|
||||
->latest()
|
||||
->paginate(15);
|
||||
->where('nIDAppointment', '!=', null)->where('nIDAppointment', '!=', '');
|
||||
|
||||
// dd($livechat);
|
||||
if ($startDate){
|
||||
$livechat->where('dStartTime', '>=', $startDate);
|
||||
}
|
||||
|
||||
if ($endDate){
|
||||
$livechat->where('dStartTime', '<=', $endDate);
|
||||
}
|
||||
$livechat->latest()->paginate(15);
|
||||
|
||||
return response()->json(Helper::paginateResources(LivechatResource::collection($livechat)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user