mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-22 09:40:41 +08:00
fixed empty result in findByPk list
This commit is contained in:
@@ -315,9 +315,12 @@ class ActiveQuery extends \yii\base\Component
|
||||
foreach($pks as $pk) {
|
||||
if (++$i > $start && ($this->limit === null || $i <= $start + $this->limit)) {
|
||||
$key = $modelClass::tableName() . ':a:' . $modelClass::buildKey($pk);
|
||||
$data[] = $db->executeCommand('HGETALL', array($key));
|
||||
if ($type === 'One' && $this->orderBy === null) {
|
||||
break;
|
||||
$result = $db->executeCommand('HGETALL', array($key));
|
||||
if (!empty($result)) {
|
||||
$data[] = $result;
|
||||
if ($type === 'One' && $this->orderBy === null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user