thinkphp5.0模型中,添加数据时获取自增的ID

$data = new ClassesModel;
$data ->cl_grade = $cl_grade;//添加的数据
$data->save();//添加数据
$data->Id;//获取自增ID
Last modification:February 22, 2018
If you think my article is useful to you, please feel free to appreciate