yii框架中获取添加数据后的id值

1 Yii::$app->db->createCommand()->insert('month4_user',['openid'=>$openid,'integ'=>0])->execute();
2 $id=Yii::$app->db->getLastInsertID();
3 var_dump($id);

 

posted @ 2019-01-17 14:37  PHP小媛  阅读(3213)  评论(0编辑  收藏  举报