Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15848 Rev 15849
Línea 90... Línea 90...
90
                    $isJson = strpos($raw, 'json');
90
                    $isJson = strpos($raw, 'json');
91
                }
91
                }
92
            }
92
            }
93
        }
93
        }
Línea 94... Línea 94...
94
 
94
 
95
        if ($isJson) {
95
        //if ($isJson) {
96
            $startDate = $this->params()->fromQuery('startDate');
96
        $startDate = $this->params()->fromQuery('startDate');
97
            if (empty($startDate)) {
97
        if (empty($startDate)) {
98
                $startDate = date('Y-m-d');
98
            $startDate = date('Y-m-d');
Línea 99... Línea 99...
99
            }
99
        }
100
 
100
 
101
            $endDate = $this->params()->fromQuery('endDate');
101
        $endDate = $this->params()->fromQuery('endDate');
102
            if (empty($endDate)) {
102
        if (empty($endDate)) {
Línea 103... Línea 103...
103
                $endDate = date('Y-m-d');
103
            $endDate = date('Y-m-d');
104
            }
104
        }
Línea 105... Línea 105...
105
 
105
 
106
            $startDateA = '2023-01-01';
106
        $startDateA = '2023-01-01';
-
 
107
        $endDateB = '2023-05-15';
-
 
108
 
-
 
109
        $dtStartDate = \DateTime::createFromFormat('Y-n-d', $startDate);
-
 
110
        $dtEndDate = \DateTime::createFromFormat('Y-n-d', $endDate);
-
 
111
 
Línea 107... Línea 112...
107
            $endDateB = '2023-05-15';
112
        if (!$dtStartDate || !$dtEndDate) {
108
 
113
            $startDate = date('Y-m-d');
109
            $dtStartDate = \DateTime::createFromFormat('Y-n-d', $startDate);
114
            $endDate = date('Y-m-d');
110
            $dtEndDate = \DateTime::createFromFormat('Y-n-d', $endDate);
-
 
111
 
-
 
112
            if (!$dtStartDate || !$dtEndDate) {
-
 
113
                $startDate = date('Y-m-d');
-
 
114
                $endDate = date('Y-m-d');
-
 
115
            } else {
-
 
116
 
115
        } else {
-
 
116
 
Línea 117... Línea 117...
117
                if ($dtStartDate->getTimestamp() > $dtEndDate->getTimestamp()) {
117
            if ($dtStartDate->getTimestamp() > $dtEndDate->getTimestamp()) {
118
                    $startDate = date('Y-m-d');
118
                $startDate = date('Y-m-d');
119
                    $endDate = date('Y-m-d');
-
 
120
                }
-
 
121
            }
-
 
122
 
-
 
123
            $contactProgressRecordMapper = DiscoveryContactLogMapper::getInstance($this->adapter);
-
 
124
            $dailyProgress = $contactProgressRecordMapper->fetchAllDataByDateRange($currentUser->id, $startDateA, $endDateB);
-
 
125
 
-
 
Línea -... Línea 119...
-
 
119
                $endDate = date('Y-m-d');
-
 
120
            }
-
 
121
        }
-
 
122
 
-
 
123
        $contactProgressRecordMapper = DiscoveryContactLogMapper::getInstance($this->adapter);
-
 
124
        $dailyProgress = $contactProgressRecordMapper->fetchAllDataByDateRange($currentUser->id, $startDateA, $endDateB);
-
 
125
 
126
            $total = count($dailyProgress);
126
        $total = count($dailyProgress);
127
            $data = [
127
        $data = [
128
                'dailyProgress' => $dailyProgress,
128
            'dailyProgress' => $dailyProgress,
129
                'total' => 10
129
            'total' => 10
130
            ];
130
        ];
131
 
131
 
132
 
132
 
133
            return new JsonModel([
133
        return new JsonModel([
134
                'success' => true,
134
            'success' => true,
135
                'data' => $data
135
            'data' => $data
136
            ]);
136
        ]);
137
        } else {
137
        // } else {