diff --git a/library/think/db/Query.php b/library/think/db/Query.php index e8cf69b5..1ecc72d1 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -18,9 +18,10 @@ use think\Config; use think\Db; use think\db\Builder; use think\db\Connection; +use think\db\DbException; use think\Exception; -use think\exception\DbException; use think\exception\PDOException; +use think\db\exception\BindParamException; use think\db\exception\ModelNotFoundException; use think\db\exception\DataNotFoundException; use think\Loader; @@ -179,7 +180,7 @@ class Query * @param boolean $master 是否在主服务器读操作 * @param bool|string $class 指定返回的数据集对象 * @return mixed - * @throws DbBindParamException + * @throws BindParamException * @throws PDOException */ public function query($sql, $bind = [], $fetch = false, $master = false, $class = false) @@ -196,7 +197,7 @@ class Query * @param boolean $getLastInsID 是否获取自增ID * @param boolean $sequence 自增序列名 * @return int - * @throws DbBindParamException + * @throws BindParamException * @throws PDOException */ public function execute($sql, $bind = [], $fetch = false, $getLastInsID = false, $sequence = null) diff --git a/library/think/db/exception/BindParamException.php b/library/think/db/exception/BindParamException.php index 2e998875..585a0d73 100644 --- a/library/think/db/exception/BindParamException.php +++ b/library/think/db/exception/BindParamException.php @@ -11,16 +11,16 @@ namespace think\db\exception; -use think\db\Exception; +use think\exception\DbException; /** * PDO参数绑定异常 */ -class BindParamException extends Exception +class BindParamException extends DbException { /** - * DbBindParamException constructor. + * BindParamException constructor. * @param string $message * @param array $config * @param string $sql diff --git a/library/think/db/exception/DataNotFoundException.php b/library/think/db/exception/DataNotFoundException.php index 27569e90..ac0f416d 100644 --- a/library/think/db/exception/DataNotFoundException.php +++ b/library/think/db/exception/DataNotFoundException.php @@ -11,7 +11,7 @@ namespace think\db\exception; -use think\db\DbException; +use think\exception\DbException; class DataNotFoundException extends DbException { diff --git a/library/think/db/exception/ModelNotFoundException.php b/library/think/db/exception/ModelNotFoundException.php index b12db4df..aba7187b 100644 --- a/library/think/db/exception/ModelNotFoundException.php +++ b/library/think/db/exception/ModelNotFoundException.php @@ -11,7 +11,7 @@ namespace think\db\exception; -use think\db\DbException; +use think\exception\DbException; class ModelNotFoundException extends DbException { diff --git a/library/think/db/DbException.php b/library/think/exception/DbException.php similarity index 97% rename from library/think/db/DbException.php rename to library/think/exception/DbException.php index 08c2a398..11c1c932 100644 --- a/library/think/db/DbException.php +++ b/library/think/exception/DbException.php @@ -9,7 +9,7 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\db; +namespace think\exception; use think\Exception;