This commit is contained in:
2023-08-30 11:08:01 +07:00
parent 8ecbcb1a5c
commit 2f336955ab
14 changed files with 9884 additions and 7436 deletions

View File

@@ -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)));
}