eee
This commit is contained in:
+6
-3
@@ -108,7 +108,6 @@ class SqlBuilder extends Component
|
||||
*/
|
||||
private function __updateBuilder(array $string): string|bool
|
||||
{
|
||||
var_dump('UPDATE ' . $this->getFromAlias() . ' ' . 'SET' . ' ' . implode(', ', $string) . ' ' . $this->make(), $string);
|
||||
if (empty($string)) {
|
||||
return Kiri::getLogger()->logCategory('None data update.');
|
||||
}
|
||||
@@ -125,7 +124,7 @@ class SqlBuilder extends Component
|
||||
*/
|
||||
public function insert(array $attributes, bool $isBatch = false): string
|
||||
{
|
||||
$update = 'INSERT INTO ' . $this->getFromAlias();
|
||||
$update = 'INSERT INTO ' . $this->getFromAlias(true);
|
||||
if ($isBatch === false) {
|
||||
$attributes = [$attributes];
|
||||
}
|
||||
@@ -457,9 +456,13 @@ class SqlBuilder extends Component
|
||||
* QueryTrait 对象有 $from 和 $alias 属性
|
||||
* @return string
|
||||
*/
|
||||
private function getFromAlias(): string
|
||||
private function getFromAlias(bool $insert = false): string
|
||||
{
|
||||
$from = $this->query->from;
|
||||
if ($insert) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($this->query->alias !== '' && $this->query->alias !== '0') {
|
||||
$from .= ' AS ' . $this->query->alias;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user