diff --git a/SqlBuilder.php b/SqlBuilder.php index 188c6f2..3a9ba21 100644 --- a/SqlBuilder.php +++ b/SqlBuilder.php @@ -206,7 +206,8 @@ class SqlBuilder extends Component */ public function one(): string { - return $this->makeSelect($this->query->getSelect()) . $this->make() . $this->makeLimit($this->query->limit(1)); + $this->query->offset(0)->limit(1); + return $this->makeSelect($this->query->getSelect()) . $this->make() . $this->makeLimit(); } @@ -216,7 +217,7 @@ class SqlBuilder extends Component */ public function all(): string { - return $this->makeSelect($this->query->getSelect()) . $this->make() . $this->makeLimit($this->query); + return $this->makeSelect($this->query->getSelect()) . $this->make() . $this->makeLimit(); }