From 34538c2b021097f0aad0736301b8d92e2e07b05e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 10 Apr 2016 11:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=85=B3=E8=81=94=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=96=B9=E6=B3=95relation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 3 ++- library/think/db/Driver.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index d31efc33..c5b97bc4 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -590,6 +590,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess * 更新数据 * @access public * @param array $data 数据数组 + * @param array $where 更新条件 * @return integer */ public static function update($data = [], $where = []) @@ -702,7 +703,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess * @param string|array $relations 关联名 * @return Model */ - public function relation($relations) + public function relationQuery($relations) { if (is_string($relations)) { $relations = explode(',', $relations); diff --git a/library/think/db/Driver.php b/library/think/db/Driver.php index 58368b98..97c57f8e 100644 --- a/library/think/db/Driver.php +++ b/library/think/db/Driver.php @@ -1947,7 +1947,7 @@ abstract class Driver $result->isUpdate(true); // 关联查询 if (!empty($options['relation'])) { - $result->relation($options['relation']); + $result->relationQuery($options['relation']); } } $resultSet[$key] = $result; @@ -2054,7 +2054,7 @@ abstract class Driver $data->isUpdate(true); // 关联查询 if (!empty($options['relation'])) { - $data->relation($options['relation']); + $data->relationQuery($options['relation']); } } } else {