改进Query类的insert方法一处可能存在的警告错误 改进Model类一处Collection的use

This commit is contained in:
thinkphp
2017-02-08 18:06:12 +08:00
parent 22b4fff3dd
commit 13924b5a8b
2 changed files with 10 additions and 8 deletions

View File

@@ -2065,8 +2065,10 @@ class Query
$sequence = $sequence ?: (isset($options['sequence']) ? $options['sequence'] : null);
$lastInsId = $this->getLastInsID($sequence);
if ($lastInsId) {
$pk = $this->getPk($options);
$data[$pk] = $lastInsId;
$pk = $this->getPk($options);
if (is_string($pk)) {
$data[$pk] = $lastInsId;
}
}
$options['data'] = $data;
$this->trigger('after_insert', $options);