First, when creating the application, the table will uni_account
insert a data application, wherein the default_acid = 0
return value of the primary key for the table, as $uniacid
.
Then, in the table will be account
inserted in an account data, wherein the uniacid = $uniacid
return value of the primary key for the table, as $acid
.
Then updates the table uni_account
data default_acid = $acid
, that is, under normal circumstances, $uniacid
and the $acid
values are the same, but if the abnormal condition occurs during operation in the two tables, it is possible to cause different.
Finally, in the table will be uni_account_users
inserted into the user data associated with the application, wherein uniacid = $uniacid
, uid = $uid
, role = $rold
. And role
it may be clerk, operator, manager, owner, founder, vice_founder, unbind_user, expired
a role.
In other words, there is a many-to-many relationship between users and applications. One user can manage multiple applications, and one application can be authorized to be managed by multiple users.