作者 邓超

x

@@ -41,7 +41,9 @@ class DbPool { @@ -41,7 +41,9 @@ class DbPool {
41 41
42 try { 42 try {
43 // 判断是否链接中 43 // 判断是否链接中
44 - $this->client->getAttribute(\PDO::ATTR_SERVER_INFO); 44 + if($this->client->getAttribute(\PDO::ATTR_CONNECTION_STATUS)===false){
  45 + $this->connect();
  46 + }
45 }catch (\Throwable $e){ 47 }catch (\Throwable $e){
46 $this->connect(); 48 $this->connect();
47 } 49 }