权限表的建立

1,新建三张表think_auth_group,think_auth_group_access,think_auth_rules

CREATE TABLE think_auth_group(

id int(11) not null 主键auto_increment,

title char(100) NOT NULL,

状态tinyint( 1) DEFAULT NULL,

rules char(80) DEFAULT NULL,

create_time int(11) DEFAULT NULL)

ENGINE=InnoDB DEFAULT CHARSET=utf8;

微信图片_20180307174754.png

创建表 `think_auth_group_access` (

  `uid `smallint(5) unsigned NOT NULL,

  `group_id`smallint(5) unsigned NOT NULL,

  唯一密钥 `uid_group_id` (`uid`,`group_id`),

  KEY `uid` (`uid`) ,

  KEY `group_id` (`group_id`)

) ENGINE=INNODB DEFAULT CHARSET=utf8;

微信图片_20180307175024.png

CREATE TABLE think_auth_rules(

id int(11) not null 主键 auto_increment,

name varchar ( 100) NOT NULL, 

title varchar(100) NOT NULL, 

type tinyint(1) DEFAULT NULL, 

status tinyint(1) DEFAULT NULL, 

condition char(100) DEFAULT NULL,

pidsmallint( 5) DEFAULT NULL,

sort tinyint(4) DEFAULT NULL,

create_time int(11) DEFAULT NULL)

ENGINE=InnoDB DEFAULT CHARSET=utf8;

微信图片_20180307175109.png



继续学习
||
<?php echo "权限表添加";
提交重置代码
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!