改名
This commit is contained in:
+13
-3
@@ -55,7 +55,12 @@ class SqlBuilder extends Component
|
|||||||
return $this->addError('None data update.');
|
return $this->addError('None data update.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update = 'UPDATE ' . $this->tableName() . ' SET ' . implode(',', $string) . $this->conditionToString();
|
$condition = $this->conditionToString();
|
||||||
|
if (!empty($condition)) {
|
||||||
|
$condition = ' WHERE ' . $condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
$update = 'UPDATE ' . $this->tableName() . ' SET ' . implode(',', $string) . $condition;
|
||||||
$update .= $this->builderLimit($this->query);
|
$update .= $this->builderLimit($this->query);
|
||||||
|
|
||||||
return [$update, $array];
|
return [$update, $array];
|
||||||
@@ -80,7 +85,12 @@ class SqlBuilder extends Component
|
|||||||
return $this->addError('None data update.');
|
return $this->addError('None data update.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$update = 'UPDATE ' . $this->tableName() . ' SET ' . implode(',', $string) . $this->conditionToString();
|
$condition = $this->conditionToString();
|
||||||
|
if (!empty($condition)) {
|
||||||
|
$condition = ' WHERE ' . $condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
$update = 'UPDATE ' . $this->tableName() . ' SET ' . implode(',', $string) . $condition;
|
||||||
$update .= $this->builderLimit($this->query);
|
$update .= $this->builderLimit($this->query);
|
||||||
|
|
||||||
return [$update, []];
|
return [$update, []];
|
||||||
@@ -202,7 +212,7 @@ class SqlBuilder extends Component
|
|||||||
$select .= $this->builderJoin($this->query->join);
|
$select .= $this->builderJoin($this->query->join);
|
||||||
}
|
}
|
||||||
if (!empty($condition = $this->conditionToString())) {
|
if (!empty($condition = $this->conditionToString())) {
|
||||||
$select = sprintf('%s%s', $select, $condition);
|
$select = sprintf('%s WHERE %s', $select, $condition);
|
||||||
}
|
}
|
||||||
if (!empty($this->query->group)) {
|
if (!empty($this->query->group)) {
|
||||||
$select .= $this->builderGroup($this->query->group);
|
$select .= $this->builderGroup($this->query->group);
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ trait Builder
|
|||||||
$_tmp[] = $_value;
|
$_tmp[] = $_value;
|
||||||
}
|
}
|
||||||
if (!empty($_tmp)) {
|
if (!empty($_tmp)) {
|
||||||
return sprintf(' WHERE %s', implode(' AND ', $_tmp));
|
return implode(' AND ', $_tmp);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user