如何获取OctoberCMS模型最近添加的id?
- 论坛
- 如何获取OctoberCMS模型最近添加的id?
16 浏览
如何获取OctoberCMS模型最近添加的id?
这个问题已经在这里有了答案:
$doc->user_id = Auth::getUser()->id;; $doc->type = post('type'); $doc->list_num = post('list_num'); $doc->ticket = post('ticket'); $doc->contract = post('contract'); $doc_id = $doc->save();
我想从数据库中获取最后添加的模型 id。我应该怎么做?
admin 更改状态以发布 2023年5月24日