作者 karlet

feat:更新composer

@@ -14,9 +14,11 @@ class MysqlCli @@ -14,9 +14,11 @@ class MysqlCli
14 private int $period = 300; 14 private int $period = 300;
15 private int $lastReconnectTime = 0; 15 private int $lastReconnectTime = 0;
16 private $connectConfig = null; 16 private $connectConfig = null;
  17 + private $database = null;
17 18
18 public function __construct($host,$port,$database,$username,$password,$charset='utf8',$prefix='', $connectCount = 20) 19 public function __construct($host,$port,$database,$username,$password,$charset='utf8',$prefix='', $connectCount = 20)
19 { 20 {
  21 + $this->database = $database;
20 $this->prefix = $prefix; 22 $this->prefix = $prefix;
21 $this->connectConfig = [ 23 $this->connectConfig = [
22 'host' => $host, 24 'host' => $host,
@@ -114,7 +116,7 @@ class MysqlCli @@ -114,7 +116,7 @@ class MysqlCli
114 $data = $this->execute('SELECT', $sql); 116 $data = $this->execute('SELECT', $sql);
115 $newData = []; 117 $newData = [];
116 if (empty($col)) { 118 if (empty($col)) {
117 - $newsql = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME="' . $this->parseTable($table) . '" ORDER BY `ORDINAL_POSITION` ASC'; 119 + $newsql = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = "'.$this->database.'" AND TABLE_NAME="' . $this->parseTable($table) . '" ORDER BY `ORDINAL_POSITION` ASC';
118 $coldata = $this->execute('SELECT', $newsql); 120 $coldata = $this->execute('SELECT', $newsql);
119 if (!$coldata) { 121 if (!$coldata) {
120 return false; 122 return false;
@@ -24,8 +24,8 @@ class SimpleServerCoroutine @@ -24,8 +24,8 @@ class SimpleServerCoroutine
24 ]; 24 ];
25 $simpleRequest = new SimpleRequest($requestInfo); 25 $simpleRequest = new SimpleRequest($requestInfo);
26 $res = call_user_func($callback, $simpleRequest); 26 $res = call_user_func($callback, $simpleRequest);
27 - if(!$res){  
28 - $response->end(); 27 + if(empty($res)){
  28 + $response->end('');
29 }else{ 29 }else{
30 $response->end($res); 30 $response->end($res);
31 } 31 }