0
我正在开发一个应用程序,其中用户可以是doctor
或patient
。表结构如下。CodeIgniter在许多帐户之间切换
users(id, first, last, email, phone);
doctors(id, name, phone, user_id);
patients(id, name, phone, user_id);
Each user can have many doctors and patients.
以下是用户所扮演的目的。
- 用户仅用于身份验证。
- 如果用户作为患者,他可以做约会。
- 如果用户作为医生,他可以批准约会。
如果用户选择doctor accounts
,他可以从字面上可以作为doctor
整个应用程序,并同样适用于patient
也。这可以通过使用session
来实现。但我不知道如何提出解决方案。请帮助我。这项工作将更受赞赏。
为什么“医生”和“患者”是同一列但数据库表不同?规范化你的数据! – Jakub