@@ -126,18 +126,18 @@ discard block |
||
126 | 126 | case 'month': |
127 | 127 | $value = $request->all()['value']; |
128 | 128 | $range = [ |
129 | - 'start' => $value['y2'].'-'.$value['m2'].'-'.$value['d2'], |
|
130 | - 'end' => $value['y1'].'-'.$value['m1'].'-'.$value['d1'], |
|
129 | + 'start' => $value['y2'] . '-' . $value['m2'] . '-' . $value['d2'], |
|
130 | + 'end' => $value['y1'] . '-' . $value['m1'] . '-' . $value['d1'], |
|
131 | 131 | ]; |
132 | - $imgDate = $range['start'].','.$range['end']; |
|
132 | + $imgDate = $range['start'] . ',' . $range['end']; |
|
133 | 133 | break; |
134 | 134 | |
135 | 135 | case 'day': |
136 | 136 | if ($date == 'today') { |
137 | - $imgDate = date('Y-m-d').','.date('Y-m-d', strtotime(date('Y-m-d').' 2 day')); |
|
137 | + $imgDate = date('Y-m-d') . ',' . date('Y-m-d', strtotime(date('Y-m-d') . ' 2 day')); |
|
138 | 138 | } |
139 | 139 | if ($date == 'yesterday') { |
140 | - $imgDate = date('Y-m-d').','.date('Y-m-d', strtotime(date('Y-m-d').' 2 day')); |
|
140 | + $imgDate = date('Y-m-d') . ',' . date('Y-m-d', strtotime(date('Y-m-d') . ' 2 day')); |
|
141 | 141 | } |
142 | 142 | break; |
143 | 143 | } |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | |
158 | 158 | return response()->json( |
159 | 159 | [ |
160 | - 'visitimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&segment=&showtitle=1&random=6179&columns=nb_visits%2Cnb_uniq_visitors&token_auth='.$this->authToken, |
|
161 | - 'avgvisitimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&showtitle=1&random=6179&columns=avg_time_on_site&token_auth='.$this->authToken, |
|
162 | - 'bouncerateimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=bounce_rate&token_auth='.$this->authToken, |
|
163 | - 'actions_per_visit_img' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_actions_per_visit&token_auth='.$this->authToken, |
|
164 | - 'pageviewimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_pageviews%2Cnb_uniq_pageviews&token_auth='.$this->authToken, |
|
165 | - 'searchesandkeywordsimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_searches%2Cnb_keywords&token_auth='.$this->authToken, |
|
166 | - 'downloadsimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_downloads%2Cnb_uniq_downloads&token_auth='.$this->authToken, |
|
167 | - 'outlinksimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_outlinks%2Cnb_uniq_outlinks&token_auth='.$this->authToken, |
|
168 | - 'maxactionsimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=max_actions&token_auth='.$this->authToken, |
|
160 | + 'visitimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&segment=&showtitle=1&random=6179&columns=nb_visits%2Cnb_uniq_visitors&token_auth=' . $this->authToken, |
|
161 | + 'avgvisitimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&showtitle=1&random=6179&columns=avg_time_on_site&token_auth=' . $this->authToken, |
|
162 | + 'bouncerateimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=bounce_rate&token_auth=' . $this->authToken, |
|
163 | + 'actions_per_visit_img' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_actions_per_visit&token_auth=' . $this->authToken, |
|
164 | + 'pageviewimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_pageviews%2Cnb_uniq_pageviews&token_auth=' . $this->authToken, |
|
165 | + 'searchesandkeywordsimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_searches%2Cnb_keywords&token_auth=' . $this->authToken, |
|
166 | + 'downloadsimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_downloads%2Cnb_uniq_downloads&token_auth=' . $this->authToken, |
|
167 | + 'outlinksimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_outlinks%2Cnb_uniq_outlinks&token_auth=' . $this->authToken, |
|
168 | + 'maxactionsimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=max_actions&token_auth=' . $this->authToken, |
|
169 | 169 | 'data' => $data, |
170 | 170 | ] |
171 | 171 | ); |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | $range = [ |
209 | - 'start' => $data['y2'].'-'.$data['m2'].'-'.$data['d2'], |
|
210 | - 'end' => $data['y1'].'-'.$data['m1'].'-'.$data['d1'], |
|
209 | + 'start' => $data['y2'] . '-' . $data['m2'] . '-' . $data['d2'], |
|
210 | + 'end' => $data['y1'] . '-' . $data['m1'] . '-' . $data['d1'], |
|
211 | 211 | ]; |
212 | 212 | |
213 | 213 | $now = Carbon::now(); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | if ($difference > 0) { |
231 | 231 | $period = 'range'; |
232 | - $date = $range['start'].','.$range['end']; |
|
232 | + $date = $range['start'] . ',' . $range['end']; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | return $periodCheck ? $period : $date; |