From ce01539e2e54ba2a8583ee5f2c02297f9813606d Mon Sep 17 00:00:00 2001 From: Martin Kozianka Date: Mon, 25 Jun 2018 16:53:48 +0200 Subject: [PATCH] Fixed using default limit --- src/Simpletipp/Modules/SimpletippMatches.php | 10 +++++++--- src/Simpletipp/SimpletippMatchUpdater.php | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Simpletipp/Modules/SimpletippMatches.php b/src/Simpletipp/Modules/SimpletippMatches.php index 9f42c27..bccb615 100644 --- a/src/Simpletipp/Modules/SimpletippMatches.php +++ b/src/Simpletipp/Modules/SimpletippMatches.php @@ -100,10 +100,14 @@ private function getMatches() $params = array_merge( array($this->simpletippUserId, $this->simpletipp->leagueID, $this->simpletippUserId), $this->matches_filter->params - ); + ); - $result = $this->Database->prepare($sql.$this->matches_filter->stmt.$this->matches_filter->order_by) - ->limit($this->matches_filter->limit)->execute($params); + $dbStmt = $this->Database->prepare($sql.$this->matches_filter->stmt.$this->matches_filter->order_by); + if($this->matches_filter->limit != 0) { + $dbStmt->limit($this->matches_filter->limit); + } + + $result = $dbStmt->execute($params); } else { diff --git a/src/Simpletipp/SimpletippMatchUpdater.php b/src/Simpletipp/SimpletippMatchUpdater.php index 359e906..4645f5a 100644 --- a/src/Simpletipp/SimpletippMatchUpdater.php +++ b/src/Simpletipp/SimpletippMatchUpdater.php @@ -374,7 +374,7 @@ private function groupMapper($arrMatch) $replaceFrom = []; $replaceTo = []; - $replaceFrom[] = 'Gruppenphase'; $replaceTo[] = 'GP'; + $replaceFrom[] = 'Gruppenphase'; $replaceTo[] = 'G'; $replaceFrom[] = 'Achtelfinale'; $replaceTo[] = '⅛'; $replaceFrom[] = 'Viertelfinale'; $replaceTo[] = '¼'; $replaceFrom[] = 'Halbfinale'; $replaceTo[] = '½'; @@ -382,7 +382,7 @@ private function groupMapper($arrMatch) $replaceFrom[] = 'Finale'; $replaceTo[] = 'F'; $replaceFrom[] = 'Gruppe'; $replaceTo[] = ''; $replaceFrom[] = '. Spieltag'; $replaceTo[] = ''; - + $arrGroup['short'] = $strName = trim(str_replace($replaceFrom, $replaceTo, $arrGroup['name'])); return $arrGroup;