mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
修正Driver类的getBindSql方法 异常信息显示当前sql语句
This commit is contained in:
@@ -192,7 +192,7 @@ abstract class Driver
|
|||||||
$this->debug(false);
|
$this->debug(false);
|
||||||
return $this->getResult();
|
return $this->getResult();
|
||||||
} catch (\PDOException $e) {
|
} catch (\PDOException $e) {
|
||||||
throw new Exception($e->getMessage());
|
throw new Exception($this->getError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ abstract class Driver
|
|||||||
}
|
}
|
||||||
return $this->numRows;
|
return $this->numRows;
|
||||||
} catch (\PDOException $e) {
|
} catch (\PDOException $e) {
|
||||||
throw new Exception($e->getMessage());
|
throw new Exception($this->getError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,11 +256,11 @@ abstract class Driver
|
|||||||
{
|
{
|
||||||
if ($bind) {
|
if ($bind) {
|
||||||
foreach ($bind as $key => $val) {
|
foreach ($bind as $key => $val) {
|
||||||
$val = is_array($val) ? $val[0] : $val;
|
$val = $this->parseValue(is_array($val) ? $val[0] : $val);
|
||||||
// 判断占位符
|
// 判断占位符
|
||||||
$sql = is_numeric($key) ?
|
$sql = is_numeric($key) ?
|
||||||
substr_replace($sql, $val, strpos($sql, '?'), 1) :
|
substr_replace($sql, $val, strpos($sql, '?'), 1) :
|
||||||
str_replace(':' . $key, $this->parseValue($val), $sql);
|
str_replace(':' . $key, $val, $sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $sql;
|
return $sql;
|
||||||
|
|||||||
Reference in New Issue
Block a user