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

@@ -430,9 +430,10 @@ class CorporateController extends Controller
// Write Header to File
$result_headers = array_keys($headers_map_to_table_fields);
$result_headers = array_merge($result_headers, ['Ingest Code', 'Ingest Note']);
// dd($result_headers);
$import->addArrayToRow($result_headers);
}
$doc_headers_indexes = [];
foreach ($sheet->getRowIterator() as $index => $row) {
if ($index == 1) { // First Row Must be Header
@@ -447,12 +448,10 @@ class CorporateController extends Controller
// TODO Validate if First Row not Header
} else { // Next Row Should be Data
$row_data = [];
foreach ($row->getCells() as $header_index => $cell) {
if (isset($headers_map_to_table_fields[$doc_headers_indexes[$header_index]]))
$row_data[$headers_map_to_table_fields[$doc_headers_indexes[$header_index]]] = $cell->getValue();
}
try { // Process the Row Data
$corporateService = new CorporateService();
if ($sheet->getName() == 'Plan') {

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

View File

@@ -120,7 +120,6 @@ class PlanController extends Controller
$result_headers = array_keys($headers_map_to_table_fields);
array_push($result_headers, ['Ingest Code', 'Ingest Note']);
$import->addArrayToRow($result_headers);
die('fuck');
$imported_plan_data = 0;
$failed_plan_data = [];