User(用户表)
注意:在整个用户系统中,email 和 mobile 都必须是全局唯一的、实名认证过的用户必须同时校验 email 和 mobile 的真实性!
因此在用户注册时需要查询是否有重复的 email 或 mobile;实名认证过程中要确保 email 和 mobile 都被校验。
我们将系统设计为通过邮箱或手机号都可以登录,因此 User 表中的 username 字段没有实质意义,但 strapi 的默认
注册流程中又必须这个字段,因此将此字段默认设置为与用户注册时所用的邮箱或手机号一致。
strapi 默认的注册流程只能支持邮箱,手机号无法通过默认注册流程,因此需要暂时采用迂回手段。
Name | Type | Relation With | Description |
---|
username | Text | | 用户名。默认同邮箱 |
email | Email | | 邮箱 |
provider | Text | | 暂时不用 |
password | Password | | 密码 |
resetPasswordToken | Text | | 重置密码的 token |
confirmationToken | Text | | 邮箱确认码 |
confirmed | Boolean | | 邮箱是否已确认 |
blocked | Boolean | | 是否被禁 |
role | Relation | Role | 角色。默认值为 Public,实名认证后为 Authenticated |
avatar | Media(single) | | 头像 |
mobile | Text | | 手机号 |
mobileConfirmed | Boolean | | 手机号是否已确认 |
mobileConfirmationToken | Text | | 手机号确认码 |
amount | Number(float) | | 充值总额 |
balance | Number(float) | | 余额 |
invoiceBalance | Number(float) | | 可开票金额 |
signInLogs | Relation | Sign In Log | 关联登录日志 |
tickets | Relation | Ticket | 关联工单 |
vivoices | Relation | Invoice | 关联发票表 |
invoiceTitles | Relation | Invoice Title | 关联发票抬头表 |
agentId | UID | | 关联的代理商ID。代理商信息存放于独立的数据库中 |
Sign In Log(用户登录日志表)
Name | Type | Relation With | Description |
---|
ip | Text | | |
location | Text | | |
browser | Text | | |
device | Text | | |
user | Relation | User | |
Ticket(工单表)
Name | Type | Relation With | Description |
---|
title | Text | | |
ticketStatus | Enumeration | | 状态 |
priority | Enumeration | | 优先级 |
messages | Relation | Ticket Messages | |
user | Relation | User | |
Ticket Message(工单对话表)
Name | Type | Relation With | Description |
---|
content | Text | | |
images | Media(multi) | | |
Invoice(发票表)
Name | Type | Relation With | Description |
---|
name | Text | | 姓名或公司名称(必填) |
cid | Text | | (公司)纳税人识别号(公司必填) |
address | Text | | 公司地址 |
bankName | Text | | 银行名称 |
bankAccount | Text | | 公司账户 |
telephone | Text | | 电话 |
email | Text | | 接收邮箱 |
invoiceType | Enumeration | | 发票类型(必填):pupiao | zhuanpiao |
amount | Number(float) | | 开票金额 |
invoiceStatus | Enumeration | | 状态:pending | resolve | reject |
link | Text | | 下载地址 |
user | Relation | User | |
注意:由于 Invoice Title 表中的条目可以修改、删除,因此 Invoice 表不便于通过 Relation
字段关联 Invoice Title 表,并且发票开具之后就不可再变更了,因此只要记录发票的 title 即可。
Invoice Title(发票抬头表)
Name | Type | Relation With | Description |
---|
type | Enumeration | | 抬头类型(必填):person | company |
name | Text | | 姓名或公司名称(必填) |
cid | Text | | (公司)纳税人识别号(公司必填) |
address | Text | | 公司地址 |
bankName | Text | | 银行名称 |
bankAccount | Text | | 公司账户 |
telephone | Text | | 电话 |
email | Text | | 接收邮箱 |
invoiceType | Enumeration | | 发票类型(必填):pupiao | zhuanpiao |
user | Relation | User | |
isDefault | Boolean | | 是否为默认 |