mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
Query类增加failException方法 用于设置查询没有找到数据时候是否抛出异常
This commit is contained in:
@@ -89,7 +89,7 @@ abstract class Builder
|
||||
$result = [];
|
||||
foreach ($data as $key => $val) {
|
||||
if (!in_array($key, $fields, true)) {
|
||||
if ($this->connection->getConfig('fields_strict')) {
|
||||
if ($options['strict']) {
|
||||
throw new Exception(' fields not exists :[' . $key . ']');
|
||||
}
|
||||
} else {
|
||||
@@ -572,7 +572,7 @@ abstract class Builder
|
||||
foreach ($dataSet as &$data) {
|
||||
foreach ($data as $key => $val) {
|
||||
if (!in_array($key, $fields, true)) {
|
||||
if ($this->connection->getConfig('fields_strict')) {
|
||||
if ($options['strict']) {
|
||||
throw new Exception(' fields not exists :[' . $key . ']');
|
||||
}
|
||||
unset($data[$key]);
|
||||
|
||||
Reference in New Issue
Block a user