Skip to content

Conversation

@tianheng2017
Copy link
Contributor

主键别写死了,数据库主键不一定都叫id呢
当前默认取得值是AdminController的pk
特殊情况下可被控制器的自定义pk覆盖

主键别写死了,数据库主键不一定都叫id呢
当前默认取得值是AdminController的pk
特殊情况下可被控制器的自定义pk覆盖
@zhongshaofa
Copy link
Owner

zhongshaofa commented Aug 15, 2020

在控制器中,应该通过$this->model->getPk()方法去获取当前模型的主键,不需要自定义主键属性去获取

@tianheng2017
Copy link
Contributor Author

在控制器中,应该通过$this->model->getPk()方法去获取当前模型的主键,不需要自定义主键属性去获取

已改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants