fix some stupid bug

This commit is contained in:
whale
2020-04-26 15:01:18 +08:00
parent 302e2c60da
commit b0331f6346
5 changed files with 11 additions and 43 deletions

View File

@@ -69,7 +69,7 @@ class DB
}
}
public static function rawQuery(string $line, $params) {
public static function rawQuery(string $line, $params = []) {
if (ZMBuf::get("sql_log") === true) {
$starttime = microtime(true);
}
@@ -117,4 +117,8 @@ class DB
return false;
}
}
}
public static function isTableExists($table) {
return in_array($table, self::$table_list);
}
}

View File

@@ -23,6 +23,6 @@ class InsertBody
}
public function save() {
DB::rawQuery('INSERT INTO ' . $this->table->getTableName() . ' VALUES ('.implode(',', array_fill(0, 5, '?')).')', $this->row);
DB::rawQuery('INSERT INTO ' . $this->table->getTableName() . ' VALUES ('.implode(',', array_fill(0, count($this->row), '?')).')', $this->row);
}
}
}