Browse Source

Update Database.php

导入sql文件时用Qurey方法在配置了数据库读写分离的时候会出问题
cceessff 3 years ago
parent
commit
053e4eda15
1 changed files with 2 additions and 2 deletions
  1. 2 2
      application/common/util/Database.php

+ 2 - 2
application/common/util/Database.php

@@ -177,7 +177,7 @@ class Database {
             $sql .= $this->config['compress'] ? gzgets($gz) : fgets($gz);
 
             if(preg_match('/.*;$/', trim($sql))){
-                if(false !== Db::query($sql)){
+                if(false !== Db::execute($sql)){
                     $start += strlen($sql);
                 } else {
                     return false;
@@ -197,4 +197,4 @@ class Database {
     public function __destruct(){
         $this->config['compress'] ? @gzclose($this->fp) : @fclose($this->fp);
     }
-}
+}