Proyectos de Subversion LeadersLinked - Backend

Rev

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

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