diff --git a/library/think/db/Connection.php b/library/think/db/Connection.php index dee87494..24fe07f4 100644 --- a/library/think/db/Connection.php +++ b/library/think/db/Connection.php @@ -338,8 +338,8 @@ abstract class Connection * @param bool $master 是否在主服务器读操作 * @param bool $pdo 是否返回PDO对象 * @return mixed - * @throws BindParamException * @throws PDOException + * @throws \Exception */ public function query($sql, $bind = [], $master = false, $pdo = false) { @@ -400,8 +400,8 @@ abstract class Connection * @param string $sql sql指令 * @param array $bind 参数绑定 * @return int - * @throws BindParamException * @throws PDOException + * @throws \Exception */ public function execute($sql, $bind = []) { @@ -552,7 +552,7 @@ abstract class Connection * @access protected * @param bool $pdo 是否返回PDOStatement * @param bool $procedure 是否存储过程 - * @return array + * @return PDOStatement|array */ protected function getResult($pdo = false, $procedure = false) { @@ -618,7 +618,8 @@ abstract class Connection /** * 启动事务 * @access public - * @return void + * @return bool|mixed + * @throws \Exception */ public function startTrans() { @@ -782,7 +783,7 @@ abstract class Connection /** * 是否断线 * @access protected - * @param \PDOException $e 异常对象 + * @param \PDOException|\Exception $e 异常对象 * @return bool */ protected function isBreak($e) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index f18f38bc..91499647 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -2336,7 +2336,7 @@ class Query $modelName = $this->model; if (count($resultSet) > 0) { foreach ($resultSet as $key => $result) { - /** @var Model $result */ + /** @var Model $model */ $model = new $modelName($result); $model->isUpdate(true); @@ -2392,6 +2392,7 @@ class Query * @param mixed $value 缓存数据 * @param array $options 缓存参数 * @param array $bind 绑定参数 + * @return string */ protected function getCacheKey($value, $options, $bind = []) { diff --git a/library/think/model/relation/BelongsTo.php b/library/think/model/relation/BelongsTo.php index a32cc124..dfd74a59 100644 --- a/library/think/model/relation/BelongsTo.php +++ b/library/think/model/relation/BelongsTo.php @@ -11,6 +11,7 @@ namespace think\model\relation; +use think\db\Query; use think\Loader; use think\Model; @@ -68,7 +69,6 @@ class BelongsTo extends OneToOne * @param string $operator 比较操作符 * @param integer $count 个数 * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 * @return Query */ public function has($operator = '>=', $count = 1, $id = '*')