| Línea 82... |
Línea 82... |
| 82 |
|
82 |
|
| Línea 83... |
Línea 83... |
| 83 |
$habitReportMapper = \LeadersLinked\Mapper\HabitReportMapper::getInstance($this->adapter);
|
83 |
$habitReportMapper = \LeadersLinked\Mapper\HabitReportMapper::getInstance($this->adapter);
|
| 84 |
|
84 |
|
| 85 |
$listAccessDays = [];
|
85 |
$listAccessDays = [];
|
| Línea 86... |
Línea 86... |
| 86 |
$dates = $habitReportMapper->validateAndAdjustDates($filter, $initialDate, $finalDate);
|
86 |
$dates = $habitReportMapper->validateAndAdjustDates($filter, $initialDate, $finalDate);
|
| 87 |
$records = $habitReportMapper->fetchDaysIntervalsRegisterList($currentUser->id, $dates[0], $dates[1]);
|
87 |
$records = $habitReportMapper->fetchAccessDayRecordsByDayIntervals($currentUser->id, $dates[0], $dates[1]);
|
| 88 |
|
88 |
|
| 89 |
foreach ($records as $record) {
|
89 |
foreach ($records as $record) {
|
| 90 |
$listAccessDays[] = $record['date'];
|
90 |
$listAccessDays[] = $record['date'];
|
| 91 |
}
|
91 |
}
|
| 92 |
$recordsListAccessDays = $habitReportMapper->generateDateList($listAccessDays, $initialDate, $finalDate);
|
92 |
$recordsListAccessDays = $habitReportMapper->generateDateList($listAccessDays, $initialDate, $finalDate);
|
| 93 |
return new JsonModel([
|
93 |
return new JsonModel([
|
| 94 |
'success' => true,
|
94 |
'success' => true,
|
| 95 |
'data' => [
|
95 |
'data' => [
|
| 96 |
'total_days' => count($records),
|
96 |
'total_access_days' => count($records),
|
| 97 |
'list_access_days' => $recordsListAccessDays
|
97 |
'list_access_days' => $recordsListAccessDays
|
| 98 |
]
|
98 |
]
|