前端到后台ThinkPHP开发整站(1)
1、前言:
我个人从来没有写过博客文章,作为一个程序员没有自己的博客算是一个合格的程序员,所以我地想想也要经营起一个的博客,做一个小项目,写这博客算就做这个项目的一个项目笔记吧!现在自学着ThinkPHP,就借此框架做一个CMS系统。废话不多说了,赶紧进入学习了。
2、需求分析:
功能分析:
一、登录退出功能。
二、菜单功能:涉及前端菜单导航设置。
三、文章管理:文章编写,编辑插件掌握,异步图片上传。
四、推荐位管理:让用户自行设定首页推荐文章显示的设定。
五、用户管理:管理后台登录的用户和权限管理。
六、基本管理:也就是配置管理,用于修改操作网站的头部关键字,和设置是否进行生成缓存与是否自动备份数据库。
3、表设计:
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;
今天第一天写到这里,已经22点33分了,不要熬夜容易长痘,今天先把表设计好,明天进行编码!
前端到后台ThinkPHP开发整站(1)的更多相关文章
- 前端到后台ThinkPHP开发整站--php开发案例
前端到后台ThinkPHP开发整站--php开发案例 总结 还是需要做几个案例,一天一个为佳,那样才能做得快. 从需求分析着手,任务体系要构建好,这样才能非常高效. 转自: 前端到后台ThinkPHP ...
- 前端到后台ThinkPHP开发整站(2)
我这次使用的ThinkPHP版本是:3.2.3版本,还有会使用到一个弹出层插件,叫 layer,官网地址是:http://layer.layui.com/.废话不多说,进入撸码环节. 1.通用方法编写 ...
- 前端到后台ThinkPHP开发整站(6)
今天终于把整个后台管理系统弄好了,其实没什么难点,只是作为一个Thinphp学习的练手项目,这个项目,现在还只能算是做了一半,还有前台展示方面的功能没有完成.先过一遍后台的功能吧! 1.首页 2.菜单 ...
- 前端到后台ThinkPHP开发整站(5)
今天周五了,这个项目做了五个晚上了,明天周末不用上班有一整天的时间来结束这个项目了,今晚主要把后台界面给弄出来了. 大概的整个后台界面就是这个样子了,接下来的工作就是搬砖了,一个个菜单功能填上去就是了 ...
- 前端到后台ThinkPHP开发整站(4)
今晚继续我的这个项目的开发,今晚也是写的不多,主要写了一个菜单管理功能的CURD方法,前端界面还没有进行编写. 菜单管理Model层的代码: <?php namespace Common\Mod ...
- 前端到后台ThinkPHP开发整站(3)
继续我的这个项目的第三晚的开发了,时间比较少,今晚写的代码不多,今晚仍然是造轮子写一个公共的控制器和一个公共的JS.直接上代码吧! 以下是一个公共的控制器,后台控制器都继承于它,构造函数中进行验证当前 ...
- 前端到后台ThinkPHP开发整站(7)
今晚我继续这个项目的前台开发,把前台的做出来了,现在项目进行一个收尾工作了,还有栏目页和一个文章页的开发,做完这两个算是完成了.说到这里感觉有点松懈了,把剩下两个功能页面做完在吹吧,先看看今天弄的代码 ...
- 前端到后台ThinkPHP开发整站(完)
久违了,今天终于抽空把最后的写完了,这是这个项目的最后一篇文章了,把前台的栏目控制器和文章内容控制器的功能实现了. 栏目控制器: <?php namespace Home\Controller; ...
- 前端资源多个产品整站一键打包&包版本管理(一)
来新公司工作的第五个月.整站资源打包管理也提上了日程. 问题: 首先.什么是整站的打包管理呢? 我们公司的几个重要产品都在同一个webapp里面,但是,不同的开发部门独立开发不同的产品,长期以来,我们 ...
随机推荐
- 4.Smarty模板之间调用
{include file="header.tpl" name="cai"}
- HTML5 Web SQL 数据库操作
Web SQL 数据库 API 并不是 HTML5 规范的一部分,但是它是一个独立的规范,引入了一组使用 SQL 操作客户端数据库的 APIs. 以下是规范中定义的三个核心方法: openDataba ...
- Android 测试 Appium、Robotium、monkey等框架或者工具对比
1. Appium测试 (功能测试,用户接受度测试,黑盒测试) - Rating: 8 Appium测试相当于黑盒测试.只是测试UI逻辑正确性.所以Appium测试框架提供的方法有限.获取一个Appi ...
- ASP.NET Core 四种释放 IDisposable 对象的方法
本文翻译自<Four ways to dispose IDisposables in ASP.NET Core>,由于水平有限,故无法保证翻译完全正确,欢迎指出错误.谢谢! IDispos ...
- 新闻信息的javaBean
//新闻信息的javaBeanpublic class News { //新闻属性 private int id; //id private int categoryId ;//新闻类别id priv ...
- Bootstrap提示框
前面的话 提示框是一个比较常见的功能,一般来说是鼠标移动到特定元素上时,显示相关的提示语.本文将详细介绍Bootstrap提示框 基本用法 Bootstrap框架中的提示框,结构非常简单,常常使用的是 ...
- RabbitMQ系列教程之七:RabbitMQ的 C# 客户端 API 的简介
今天这篇博文是我翻译的RabbitMQ的最后一篇文章了,介绍一下RabbitMQ的C#开发的接口.好了,言归正传吧. Net/C# 客户端 API简介1.主要的命名空间,接口和类 定义核心的API的 ...
- threejs里面的vector3源码解析
// File:src/math/Vector3.js /** * @author mrdoob / http://mrdoob.com/ * @author *kile / http://kile. ...
- 新篇章之我的java学习之路下
昨天写下了人生的第一篇博客,今天接着写我的java学习之路有关开发及框架的学习过程. 想要学好java语言,只学习一些java的基本语法对实际开发中的用处还是不大的,所以我们还要掌握一些有关javaW ...
- java核心机制
Java中有两种核心机制:Java虚拟机(Java Virtual Machine).垃圾收集机制(Garbage collection) 一.核心机制之Java虚拟机 ① Java虚拟机可以理解成一 ...