mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
改进Connection类connect方法的异常处理 改进Query类一处可能的问题
This commit is contained in:
@@ -286,7 +286,7 @@ abstract class Connection
|
|||||||
Log::record($e->getMessage(), 'error');
|
Log::record($e->getMessage(), 'error');
|
||||||
return $this->connect($autoConnection, $linkNum);
|
return $this->connect($autoConnection, $linkNum);
|
||||||
} else {
|
} else {
|
||||||
throw new Exception($e->getMessage());
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -747,7 +747,7 @@ class Query
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->options['field'])) {
|
if (isset($this->options['field'])) {
|
||||||
$field = array_merge($this->options['field'], $field);
|
$field = $this->options['field'] + $field;
|
||||||
}
|
}
|
||||||
$this->options['field'] = $field;
|
$this->options['field'] = $field;
|
||||||
return $this;
|
return $this;
|
||||||
@@ -1415,8 +1415,10 @@ class Query
|
|||||||
{
|
{
|
||||||
$types = $this->getFieldsType($options);
|
$types = $this->getFieldsType($options);
|
||||||
$bind = [];
|
$bind = [];
|
||||||
foreach ($types as $key => $type) {
|
if ($types) {
|
||||||
$bind[$key] = $this->getFieldBindType($type);
|
foreach ($types as $key => $type) {
|
||||||
|
$bind[$key] = $this->getFieldBindType($type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $bind;
|
return $bind;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user