yii save后获取保存数据的id

$chapterComment->save();
$id = $chapterComment->attributes['id'];
var_dump($id);
原文地址:https://www.cnblogs.com/klj123wan/p/3134003.html