首页 > 其他 > 详细

yii2 adminlte后台搭建

时间:2019-03-10 10:32:15      阅读:148      评论:0      收藏:0      [点我收藏+]

加载第三方扩展,

composer require dmstr/yii2-adminlte-asset "2.*"
composer require mdmsoft/yii2-admin "~2.0"

 

CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT "自增ID",  
`username` varchar(255) NOT NULL COMMENT "用户名",  
`auth_key` varchar(32) NOT NULL COMMENT "自动登录key",  
`password_hash` varchar(255) NOT NULL COMMENT "加密密码",  
`password_reset_token` varchar(255) DEFAULT NULL COMMENT "重置密码token",  
`email` varchar(255) NOT NULL COMMENT "邮箱",  
`role` smallint(6) NOT NULL DEFAULT "10" COMMENT "角色等级",  
`status` smallint(6) NOT NULL DEFAULT "10" COMMENT "状态",  
`created_at` int(11) NOT NULL COMMENT "创建时间",  
`updated_at` int(11) NOT NULL COMMENT "更新时间",  
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT="用户表";


create table `menu`
(
    `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `name` varchar(128),
    `parent` int(11),
    `route` varchar(256),
    `order` int(11),
    `data`   blob,
    foreign key (`parent`) references `menu`(`id`)  ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
drop table if exists `auth_assignment`;
drop table if exists `auth_item_child`;
drop table if exists `auth_item`;
drop table if exists `auth_rule`;

create table `auth_rule`
(
   `name`                 varchar(64) not null,
   `data`                 text,
   `created_at`           integer,
   `updated_at`           integer,
    primary key (`name`)
) engine InnoDB;

create table `auth_item`
(
   `name`                 varchar(64) not null,
   `type`                 integer not null,
   `description`          text,
   `rule_name`            varchar(64),
   `data`                 text,
   `created_at`           integer,
   `updated_at`           integer,
   primary key (`name`),
   foreign key (`rule_name`) references `auth_rule` (`name`) on delete set null on update cascade,
   key `type` (`type`)
) engine InnoDB;

create table `auth_item_child`
(
   `parent`               varchar(64) not null,
   `child`                varchar(64) not null,
   primary key (`parent`, `child`),
   foreign key (`parent`) references `auth_item` (`name`) on delete cascade on update cascade,
   foreign key (`child`) references `auth_item` (`name`) on delete cascade on update cascade
) engine InnoDB;

create table `auth_assignment`
(
   `item_name`            varchar(64) not null,
   `user_id`              varchar(64) not null,
   `created_at`           integer,
   primary key (`item_name`, `user_id`),
   foreign key (`item_name`) references `auth_item` (`name`) on delete cascade on update cascade
) engine InnoDB;

 

yii2 adminlte后台搭建

原文:https://www.cnblogs.com/huay/p/10504390.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!