thinkphp写入一条数据,同时取得这条数据的ID,该怎么解决

2025-03-31 03:25:41
推荐回答(1个)
回答1:

$id = $model ->data($data)->add();
或$id = $model->add($data);

return $id;