【发布时间】:2014-01-05 05:29:11
【问题描述】:
我正在开发一个应用程序,其中用户可以是doctor 或patient。表结构如下。
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 来实现。但我不知道如何提出解决方案。请帮帮我。这项工作将受到更多赞赏。
【问题讨论】:
-
为什么
doctors和patients是相同的列但不同的数据库表?规范化您的数据!
标签: codeigniter session switch-statement codeigniter-2 user-accounts