modify
This commit is contained in:
@@ -177,7 +177,7 @@ class SqlBuilder extends Component
|
||||
public function one(): string
|
||||
{
|
||||
$this->query->limit(0, 1);
|
||||
if (empty($this->from)) {
|
||||
if (empty($this->query->from) && !empty($this->query->modelClass)) {
|
||||
$this->query->from($this->query->getTable());
|
||||
}
|
||||
return $this->_prefix(true);
|
||||
@@ -190,7 +190,7 @@ class SqlBuilder extends Component
|
||||
*/
|
||||
public function all(): string
|
||||
{
|
||||
if (empty($this->from)) {
|
||||
if (empty($this->query->from) && !empty($this->query->modelClass)) {
|
||||
$this->query->from($this->query->getTable());
|
||||
}
|
||||
return $this->_prefix(true);
|
||||
@@ -203,7 +203,7 @@ class SqlBuilder extends Component
|
||||
*/
|
||||
public function count(): string
|
||||
{
|
||||
if (empty($this->from)) {
|
||||
if (empty($this->query->from) && !empty($this->query->modelClass)) {
|
||||
$this->query->from($this->query->getTable());
|
||||
}
|
||||
return $this->_prefix();
|
||||
|
||||
Reference in New Issue
Block a user