Proyectos de Subversion LeadersLinked - Services

Rev

Rev 380 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 380 Rev 381
Línea 81... Línea 81...
81
            $currentUser = $currentUserPlugin->getUser();
81
            $currentUser = $currentUserPlugin->getUser();
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($initialDate, $finalDate);
86
            $dates = $habitReportMapper->validateAndAdjustDates($filter, $initialDate, $finalDate);
87
            $records = $habitReportMapper->fetchDaysIntervalsRegisterList($currentUser->id, $dates[0], $dates[1]);
87
            $records = $habitReportMapper->fetchDaysIntervalsRegisterList($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
            return new JsonModel([
93
            return new JsonModel([
93
                'success' => true,
94
                'success' => true,
94
                'data' => [
95
                'data' => [
95
                    'total_days' => count($records),
96
                    'total_days' => count($records),
96
                    'list_access_days' => $listAccessDays
97
                    'list_access_days' => $recordsListAccessDays
97
                ]
98
                ]
98
            ]);
99
            ]);