您的位置:首页 > 编程语言 > PHP开发

前端到后台ThinkPHP开发整站(1)

2017-07-29 18:42 134 查看
1、需求分析:

功能分析:

一、登录退出功能。

二、菜单功能:涉及前端菜单导航设置。

三、文章管理:文章编写,编辑插件掌握,异步图片上传。

四、推荐位管理:让用户自行设定首页推荐文章显示的设定。

五、用户管理:管理后台登录的用户和权限管理。

六、基本管理:也就是配置管理,用于修改操作网站的头部关键字,和设置是否进行生成缓存与是否自动备份数据库。

2、需求分析:

功能分析:

一、登录退出功能。

二、菜单功能:涉及前端菜单导航设置。

三、文章管理:文章编写,编辑插件掌握,异步图片上传。

四、推荐位管理:让用户自行设定首页推荐文章显示的设定。

五、用户管理:管理后台登录的用户和权限管理。

六、基本管理:也就是配置管理,用于修改操作网站的头部关键字,和设置是否进行生成缓存与是否自动备份数据库。

3、表设计:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91
CREATE
DATABASE
`tp_cms`;


CREATE
TABLE
`cms_admin`(


`admin_id`
mediumint(6)unsigned
NOT
NULL
AUTO_INCREMENT,


`user_name`
varchar
(20)
not
null
default
''
COMMENT
'管理员ID'
,


`
password
`
varchar
(32)
not
null
default
''
COMMENT
'密码'
,


`last_login_ip`
varchar
(15)
default
'0'
COMMENT
'最后登录IP'
,


`last_login_time`
int
(10)
unsigned
default
'0'
comment
'最后登录时间'
,


`email`
varchar
(40)
default
''
comment
'邮箱地址'
,


`real_name`
varchar
(50)
not
null
default
''
comment
'真实姓名'
,


`status`
tinyint(1)
not
null
default
'1'
comment
'状态'
,


primary
key
(`admin_id`),


key
`user_name`
(`user_name`)


)COMMENT=
'后台用户表'
ENGINE=MyISAM
AUTO_INCREMENT=1
DEFAULT
CHARSET=utf8;


create
table
`cms_menu`
(


`menu_id`
smallint
(6)
unsigned
not
null
auto_increment
comment
'菜单ID'
,


`
name
`
varchar
(40)
not
null
default
''
comment
'菜单名'
,


`parentid`
smallint
(6)
not
null
default
'0'
comment
'父级菜单'
,


`m`
varchar
(20)
not
null
default
''
,


`c`
varchar
(20)
not
null
default
''
,


`f`
varchar
(20)
not
null
default
''
,


`listorder`
smallint
(6)
unsigned
not
null
default
'0'
comment
'序号'
,


`status`
tinyint(1)unsigned 
not
null
default
'1'
comment
'状态'
,


`type`
tinyint(1) unsigned
not
null
default
'0'
comment
'类型'
,


primary
key
(`menu_id`),


key
`listorder`
(`listorder`),


key
`parentid`
(`parentid`),


key
`module`
(`m`,`c`,`f`)


)COMMENT=
'菜单表'
ENGINE=MyISAM
AUTO_INCREMENT=1
DEFAULT
CHARSET=UTF8;


create
table
`cms_news`
(


`news_id`
mediumint(8) unsigned
not
null
auto_increment
comment
'新闻ID'
,


`catid`
smallint
(5)
unsigned
not
null
default
'0'
comment
'栏目ID'
,


`title`
varchar
(80)
not
null
default
'标题'
,


`small_title`
varchar
(30)
not
null
default
'小标题'
,


`title_font_color`
varchar
(250)
default
null
comment
'标题颜色'
,


`thumb`
varchar
(100)
not
null
default
''
comment
'主题'
,


`keywords`
char
(40)
not
null
default
''
comment
'关键字'
,


`description`
varchar
(250)
not
null
comment
'文章描述'
,


`listorder`
tinyint(3) unsigned
not
null
default
'0'
comment
'序号'
,


`status`
tinyint(1)
not
null
default
'1'
comment
'状态'
,


`copyfrom`
varchar
(250)
default
null
comment
'文章来源'
,


`user_name`
char
(20)
not
null
comment
'用户'
,


`create_time`
int
(10)
unsigned
not
null
default
'0'
comment
'创建时间'
,


`update_time`
int
(10)
unsigned
not
null
default
'0'
comment
'更新时间'
,


`
count
`
int
(10)
unsigned
not
null
default
'0'
comment
'总数'
,


primary
key
(`news_id`),


key
`listorder`(`listorder`),


key
`catid`(`catid`)


)COMMENT=
'新闻文章主表'
ENGINE=MyISAM
AUTO_INCREMENT=1
DEFAULT
CHARSET=UTF8;


create
table
`cms_news_content`(


`id`
mediumint(8) unsigned
not
null
auto_increment
comment
'Id'
,


`news_id`
mediumint(8) unsigned
not
null
comment
'新闻ID'
,


`content`
mediumtext
not
null
comment
'内容'
,


`create_time`
int
(10)
unsigned
not
null
default
'0'
comment
'创建时间'
,


`update_time`
int
(10)
unsigned
not
null
default
'0'
comment
'更新时间'
,


primary
key
(`id`),


key
`news_id`
(`news_id`)


)COMMENT=
'新闻文章内容副表'
ENGINE=MyISAM
AUTO_INCREMENT=1
DEFAULT
CHARSET=UTF8;


create
table
`cms_position`(


`id`
smallint
(5)
unsigned
not
null
auto_increment
comment
'id'
,


`
name
`
char
(30)
not
null
default
''
comment
'名称'
,


`status`
tinyint(1)
not
null
default
'1'
comment
'状态'
,


`description`
char
(100)
default
null
comment
'描述'
,


`create_time`
int
(10)
unsigned
not
null
default
'0'
comment
'创建时间'
,


`update_time`
int
(10)
unsigned
not
null
default
'0'
comment
'更新时间'
,


primary
key
(`id`)


)COMMENT=
'推荐位管理表'
ENGINE=MyISAM
AUTO_INCREMENT=1
DEFAULT
CHARSET=UTF8;


create
table
`cms_position_content`(


`id`
smallint
(5)
unsigned
not
null
auto_increment
comment
'id'
comment
'id'
,


`positon_id`
int
(5)
unsigned
not
null
comment
'推荐表ID'
,


`title`
varchar
(30)
not
null
default
''
comment
'标题'
,


`thumb`
varchar
(100)
not
null
default
''
comment
'主题'
,


`url`
varchar
(100)
default
null
comment
'地址'
,


`news_id`
mediumint(8) unsigned
not
null
comment
'新闻ID'
,


`listorder`
tinyint(3) unsigned
not
null
default
'0'
comment
'排序ID'
,


`status`
tinyint(1)
not
null
default
'1'
comment
'状态'
,


`create_time`
int
(10)
unsigned
not
null
default
'0'
comment
'创建时间'
,


`update_time`
int
(10)
unsigned
not
null
default
'0'
comment
'更新时间'
,


primary
key
(`id`),


key
`positon_id`
(`positon_id`)


)COMMENT=
'推荐位内容表'
ENGINE=MyISAM
AUTO_INCREMENT=1
DEFAULT
CHARSET=UTF8;


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: