From 4ab5ce3b5e6f5837240991c61803ac82d13ec7dc Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 21 May 2013 15:32:13 -0400 Subject: [PATCH] Fixed join query for AR. --- yii/db/ActiveQuery.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yii/db/ActiveQuery.php b/yii/db/ActiveQuery.php index dac94c8..cfe9c3f 100644 --- a/yii/db/ActiveQuery.php +++ b/yii/db/ActiveQuery.php @@ -236,6 +236,9 @@ class ActiveQuery extends Query if ($this->sql === null) { if ($this->from === null) { $tableName = $modelClass::tableName(); + if ($this->select === null && !empty($this->join)) { + $this->select = array("$tableName.*"); + } $this->from = array($tableName); } /** @var $qb QueryBuilder */