php开发(CI框架使用)

年前接了一个外包项目,要求使用PHP,琢磨来琢磨去,感叹道PHP框架实在是太多了!去知乎搜索一轮,最后决定使用CI,

相关议论如下:https://www.zhihu.com/question/21617669(备注:不代表个人观点,站在个人角度其实也无他,就是这个框架实在比较简单些,而且文档健全、小巧灵活)

于是呼,便着手做了个小练习,页面的话使用bootstrap,其实实在没想到要做什么功能,于是想到山寨CNZZ:http://tongji.cnzz.com/;

大家对比看看,多么的像啊!

php开发(CI框架使用)_第1张图片php开发(CI框架使用)_第2张图片

 

觉得不像其实也没啥关系哈,做着玩呗,开心就好

言归正转,我们还是回到技术的话题!

第一步,我们将相关的表建好:

建表语句如下:

# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 192.168.1.109 (MySQL 5.1.73)
# Database: howframework
# Generation Time: 2015-12-20 04:50:11 +0000
# ************************************************************


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


# Dump of table admin_settings
# ------------------------------------------------------------

DROP TABLE IF EXISTS `admin_settings`;

CREATE TABLE `admin_settings` (
  `k` varchar(32) NOT NULL DEFAULT '',
  `v` text NOT NULL,
  PRIMARY KEY (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

LOCK TABLES `admin_settings` WRITE;
/*!40000 ALTER TABLE `admin_settings` DISABLE KEYS */;

INSERT INTO `admin_settings` (`k`, `v`)
VALUES
    ('appname','umeet');

/*!40000 ALTER TABLE `admin_settings` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table admin_user
# ------------------------------------------------------------

DROP TABLE IF EXISTS `admin_user`;

CREATE TABLE `admin_user` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
  `email` varchar(50) NOT NULL DEFAULT '' COMMENT 'Email地址',
  `phone` bigint(11) unsigned NOT NULL DEFAULT '0' COMMENT '手机号',
  `password` char(32) NOT NULL DEFAULT '' COMMENT '密码',
  `salt` char(5) NOT NULL DEFAULT '' COMMENT '密码SALT',
  `qq` bigint(11) unsigned NOT NULL DEFAULT '0' COMMENT 'QQ号',
  `wechat` varchar(20) NOT NULL DEFAULT '' COMMENT '微信',
  `nickname` varchar(20) NOT NULL DEFAULT '' COMMENT '昵称',
  `remark` varchar(100) NOT NULL DEFAULT '' COMMENT '备注',
  `type` tinyint(1) NOT NULL DEFAULT '3' COMMENT '1-超级管理员, 2-管理员, 3-用户',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '-1-删除, 1-正常, 2-禁止登陆',
  `login_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登入次数',
  `last_login_ip` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后登陆IP',
  `last_login_time` datetime NOT NULL COMMENT '最后登陆时间',
  `create_time` datetime NOT NULL COMMENT '帐号创建时间',
  `update_time` datetime NOT NULL COMMENT '帐号最后编辑时间',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `phone` (`phone`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='管理用户表';

LOCK TABLES `admin_user` WRITE;
/*!40000 ALTER TABLE `admin_user` DISABLE KEYS */;

INSERT INTO `admin_user` (`uid`, `username`, `email`, `phone`, `password`, `salt`, `qq`, `wechat`, `nickname`, `remark`, `type`, `state`, `login_count`, `last_login_ip`, `last_login_time`, `create_time`, `update_time`)
VALUES
    (1,'wuyu','[email protected]',13699722401,'1d9fb62dd7d55c35e9ba905bcf47cfa2','B6JQR',6262609,'wuyu-im','吴宇','这是一个描述',1,1,27,2130706433,'2015-12-16 00:36:21','2015-12-06 04:52:27','2015-12-07 23:16:17'),
    (4,'admin','[email protected]',13800138000,'af5f10b45ebbf97d98967a9b88901479','2S667',0,'','Administrator','',1,1,4,2130706433,'2015-12-06 20:04:52','2015-12-06 05:22:03','1970-01-01 08:00:00');

/*!40000 ALTER TABLE `admin_user` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table analytics_daily
# ------------------------------------------------------------

DROP TABLE IF EXISTS `analytics_daily`;

CREATE TABLE `analytics_daily` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dateline` datetime NOT NULL COMMENT '记录日期',
  `phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登记手机数',
  `old_phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '老手机重新安装',
  `register` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新注册用户',
  `dau` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'DAU',
  `active_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃秒数',
  `launch` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '启动应用次数',
  `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `logout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注销次数',
  `xd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单次数',
  `xd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0总等待秒数',
  `xd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0平均等待秒数',
  `xd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD0次数',
  `xd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD1次数',
  `xd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_ready次数',
  `xd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_start次数',
  `xd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd_end次数',
  `pay` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付成功次数',
  `pay_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付失败次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `pay_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `xd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出1星数',
  `xd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出2星数',
  `xd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出3星数',
  `xd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出4星数',
  `xd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出5星数',
  `xd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均发出星数',
  `xd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到1星数',
  `xd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到2星数',
  `xd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到3星数',
  `xd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到4星数',
  `xd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到5星数',
  `xd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均收到星数',
  `jd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单次数',
  `jd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0总等待秒数',
  `jd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0平均等待秒数',
  `jd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD0次数',
  `jd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD1次数',
  `jd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_ready次数',
  `jd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_start次数',
  `jd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd_end次数',
  `income` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款成功次数',
  `income_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款失败次数',
  `income_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款总金额',
  `income_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `jd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出1星数',
  `jd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出2星数',
  `jd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出3星数',
  `jd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出4星数',
  `jd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出5星数',
  `jd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均发出星数',
  `jd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到1星数',
  `jd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到2星数',
  `jd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到3星数',
  `jd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到4星数',
  `jd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到5星数',
  `jd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均收到星数',
  PRIMARY KEY (`id`),
  KEY `dateline` (`dateline`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='日统计表';



# Dump of table analytics_daily_android
# ------------------------------------------------------------

DROP TABLE IF EXISTS `analytics_daily_android`;

CREATE TABLE `analytics_daily_android` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dateline` datetime NOT NULL COMMENT '记录日期',
  `phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登记手机数',
  `old_phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '老手机重新安装',
  `register` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新注册用户',
  `dau` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'DAU',
  `active_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃秒数',
  `launch` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '启动应用次数',
  `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `logout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注销次数',
  `xd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单次数',
  `xd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0总等待秒数',
  `xd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0平均等待秒数',
  `xd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD0次数',
  `xd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD1次数',
  `xd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_ready次数',
  `xd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_start次数',
  `xd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd_end次数',
  `pay` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付成功次数',
  `pay_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付失败次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `pay_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `xd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出1星数',
  `xd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出2星数',
  `xd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出3星数',
  `xd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出4星数',
  `xd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出5星数',
  `xd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均发出星数',
  `xd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到1星数',
  `xd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到2星数',
  `xd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到3星数',
  `xd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到4星数',
  `xd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到5星数',
  `xd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均收到星数',
  `jd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单次数',
  `jd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0总等待秒数',
  `jd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0平均等待秒数',
  `jd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD0次数',
  `jd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD1次数',
  `jd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_ready次数',
  `jd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_start次数',
  `jd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd_end次数',
  `income` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款成功次数',
  `income_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款失败次数',
  `income_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款总金额',
  `income_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `jd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出1星数',
  `jd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出2星数',
  `jd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出3星数',
  `jd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出4星数',
  `jd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出5星数',
  `jd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均发出星数',
  `jd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到1星数',
  `jd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到2星数',
  `jd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到3星数',
  `jd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到4星数',
  `jd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到5星数',
  `jd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均收到星数',
  PRIMARY KEY (`id`),
  KEY `dateline` (`dateline`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='日统计表';



# Dump of table analytics_daily_female
# ------------------------------------------------------------

DROP TABLE IF EXISTS `analytics_daily_female`;

CREATE TABLE `analytics_daily_female` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dateline` datetime NOT NULL COMMENT '记录日期',
  `phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登记手机数',
  `old_phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '老手机重新安装',
  `register` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新注册用户',
  `dau` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'DAU',
  `active_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃秒数',
  `launch` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '启动应用次数',
  `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `logout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注销次数',
  `xd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单次数',
  `xd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0总等待秒数',
  `xd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0平均等待秒数',
  `xd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD0次数',
  `xd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD1次数',
  `xd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_ready次数',
  `xd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_start次数',
  `xd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd_end次数',
  `pay` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付成功次数',
  `pay_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付失败次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `pay_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `xd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出1星数',
  `xd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出2星数',
  `xd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出3星数',
  `xd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出4星数',
  `xd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出5星数',
  `xd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均发出星数',
  `xd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到1星数',
  `xd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到2星数',
  `xd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到3星数',
  `xd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到4星数',
  `xd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到5星数',
  `xd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均收到星数',
  `jd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单次数',
  `jd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0总等待秒数',
  `jd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0平均等待秒数',
  `jd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD0次数',
  `jd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD1次数',
  `jd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_ready次数',
  `jd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_start次数',
  `jd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd_end次数',
  `income` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款成功次数',
  `income_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款失败次数',
  `income_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款总金额',
  `income_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `jd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出1星数',
  `jd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出2星数',
  `jd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出3星数',
  `jd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出4星数',
  `jd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出5星数',
  `jd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均发出星数',
  `jd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到1星数',
  `jd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到2星数',
  `jd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到3星数',
  `jd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到4星数',
  `jd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到5星数',
  `jd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均收到星数',
  PRIMARY KEY (`id`),
  KEY `dateline` (`dateline`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='日统计表';



# Dump of table analytics_daily_ios
# ------------------------------------------------------------

DROP TABLE IF EXISTS `analytics_daily_ios`;

CREATE TABLE `analytics_daily_ios` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dateline` datetime NOT NULL COMMENT '记录日期',
  `phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登记手机数',
  `old_phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '老手机重新安装',
  `register` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新注册用户',
  `dau` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'DAU',
  `active_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃秒数',
  `launch` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '启动应用次数',
  `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `logout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注销次数',
  `xd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单次数',
  `xd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0总等待秒数',
  `xd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0平均等待秒数',
  `xd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD0次数',
  `xd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD1次数',
  `xd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_ready次数',
  `xd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_start次数',
  `xd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd_end次数',
  `pay` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付成功次数',
  `pay_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付失败次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `pay_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `xd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出1星数',
  `xd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出2星数',
  `xd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出3星数',
  `xd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出4星数',
  `xd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出5星数',
  `xd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均发出星数',
  `xd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到1星数',
  `xd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到2星数',
  `xd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到3星数',
  `xd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到4星数',
  `xd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到5星数',
  `xd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均收到星数',
  `jd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单次数',
  `jd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0总等待秒数',
  `jd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0平均等待秒数',
  `jd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD0次数',
  `jd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD1次数',
  `jd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_ready次数',
  `jd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_start次数',
  `jd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd_end次数',
  `income` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款成功次数',
  `income_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款失败次数',
  `income_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款总金额',
  `income_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `jd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出1星数',
  `jd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出2星数',
  `jd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出3星数',
  `jd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出4星数',
  `jd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出5星数',
  `jd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均发出星数',
  `jd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到1星数',
  `jd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到2星数',
  `jd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到3星数',
  `jd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到4星数',
  `jd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到5星数',
  `jd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均收到星数',
  PRIMARY KEY (`id`),
  KEY `dateline` (`dateline`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='日统计表';



# Dump of table analytics_daily_male
# ------------------------------------------------------------

DROP TABLE IF EXISTS `analytics_daily_male`;

CREATE TABLE `analytics_daily_male` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dateline` datetime NOT NULL COMMENT '记录日期',
  `phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新登记手机数',
  `old_phone` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '老手机重新安装',
  `register` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '新注册用户',
  `dau` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'DAU',
  `active_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃秒数',
  `launch` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '启动应用次数',
  `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `logout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注销次数',
  `xd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单次数',
  `xd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0总等待秒数',
  `xd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0平均等待秒数',
  `xd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD0次数',
  `xd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD1次数',
  `xd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_ready次数',
  `xd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_start次数',
  `xd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd_end次数',
  `pay` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付成功次数',
  `pay_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付失败次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `pay_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `xd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出1星数',
  `xd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出2星数',
  `xd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出3星数',
  `xd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出4星数',
  `xd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出5星数',
  `xd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均发出星数',
  `xd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到1星数',
  `xd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到2星数',
  `xd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到3星数',
  `xd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到4星数',
  `xd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到5星数',
  `xd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均收到星数',
  `jd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单次数',
  `jd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0总等待秒数',
  `jd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0平均等待秒数',
  `jd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD0次数',
  `jd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD1次数',
  `jd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_ready次数',
  `jd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_start次数',
  `jd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd_end次数',
  `income` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款成功次数',
  `income_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款失败次数',
  `income_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款总金额',
  `income_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `jd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出1星数',
  `jd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出2星数',
  `jd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出3星数',
  `jd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出4星数',
  `jd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出5星数',
  `jd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均发出星数',
  `jd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到1星数',
  `jd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到2星数',
  `jd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到3星数',
  `jd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到4星数',
  `jd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到5星数',
  `jd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均收到星数',
  PRIMARY KEY (`id`),
  KEY `dateline` (`dateline`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='日统计表';



# Dump of table analytics_member
# ------------------------------------------------------------

DROP TABLE IF EXISTS `analytics_member`;

CREATE TABLE `analytics_member` (
  `uid` int(10) unsigned NOT NULL COMMENT '用户ID',
  `launch` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '启动应用次数',
  `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `logout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注销次数',
  `active` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃次数',
  `active_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃秒数',
  `xd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单次数',
  `xd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0总等待秒数',
  `xd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd到xd0平均等待秒数',
  `xd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD0次数',
  `xd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD1次数',
  `xd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_ready次数',
  `xd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD_start次数',
  `xd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd_end次数',
  `pay` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付成功次数',
  `pay_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付失败次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `pay_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `xd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出1星数',
  `xd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出2星数',
  `xd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出3星数',
  `xd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出4星数',
  `xd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出5星数',
  `xd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均发出星数',
  `xd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到1星数',
  `xd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到2星数',
  `xd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到3星数',
  `xd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到4星数',
  `xd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD收到5星数',
  `xd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均收到星数',
  `jd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单次数',
  `jd_wait_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0总等待秒数',
  `jd_wait_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd到jd0平均等待秒数',
  `jd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD0次数',
  `jd1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD1次数',
  `jd_ready` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_ready次数',
  `jd_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD_start次数',
  `jd_end` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'jd_end次数',
  `income` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款成功次数',
  `income_fail` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款失败次数',
  `income_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款总金额',
  `income_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均每单金额',
  `jd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出1星数',
  `jd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出2星数',
  `jd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出3星数',
  `jd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出4星数',
  `jd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出5星数',
  `jd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均发出星数',
  `jd_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到1星数',
  `jd_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到2星数',
  `jd_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到3星数',
  `jd_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到4星数',
  `jd_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD收到5星数',
  `jd_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均收到星数',
  PRIMARY KEY (`uid`),
  KEY `xd` (`xd`),
  KEY `xd0` (`xd0`),
  KEY `pay` (`pay`),
  KEY `pay_amount` (`pay_amount`),
  KEY `jd` (`jd`),
  KEY `jd0` (`jd0`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户行为次数统计表';



# Dump of table analytics_member_daily
# ------------------------------------------------------------

DROP TABLE IF EXISTS `analytics_member_daily`;

CREATE TABLE `analytics_member_daily` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `dateline` datetime NOT NULL COMMENT '记录日期',
  `launch` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '启动应用次数',
  `login` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `logout` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注销次数',
  `active` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃次数',
  `active_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃秒数',
  `xd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `jd` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单次数',
  `income_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收款总金额',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uid_dateline` (`uid`,`dateline`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户日统计表';



# Dump of table city
# ------------------------------------------------------------

DROP TABLE IF EXISTS `city`;

CREATE TABLE `city` (
  `city_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '城市ID',
  `parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级城市ID',
  `level` tinyint(1) unsigned NOT NULL COMMENT '城市级别,1到3',
  `city_name` varchar(50) NOT NULL DEFAULT '' COMMENT '城市名',
  `lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '城市中心的lat',
  `lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '城市中心的lon',
  PRIMARY KEY (`city_id`),
  KEY `parent_id` (`parent_id`),
  KEY `level` (`level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='城市表';



# Dump of table crash_log
# ------------------------------------------------------------

DROP TABLE IF EXISTS `crash_log`;

CREATE TABLE `crash_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `dateline` datetime NOT NULL COMMENT '时间',
  `phone_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '手机ID',
  `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `code` varchar(100) NOT NULL DEFAULT '' COMMENT '错误代码',
  `report` varchar(5000) NOT NULL DEFAULT '' COMMENT '报告内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='崩溃日志表';



# Dump of table member
# ------------------------------------------------------------

DROP TABLE IF EXISTS `member`;

CREATE TABLE `member` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `username` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
  `email` varchar(50) NOT NULL DEFAULT '' COMMENT 'Email地址',
  `phone_area` varchar(4) NOT NULL DEFAULT '+86' COMMENT '手机国家码',
  `phone` bigint(11) unsigned NOT NULL DEFAULT '0' COMMENT '手机号',
  `password` char(32) NOT NULL DEFAULT '' COMMENT '密码',
  `salt` char(5) NOT NULL DEFAULT '' COMMENT '密码SALT',
  `nickname` varchar(20) NOT NULL DEFAULT '' COMMENT '昵称',
  `family_name` varchar(20) NOT NULL DEFAULT '' COMMENT '',
  `given_name` varchar(20) NOT NULL DEFAULT '' COMMENT '',
  `remark` varchar(20) NOT NULL DEFAULT '' COMMENT '备注',
  `gender` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-未知, 1-男, 2-女',
  `thumb_id` int(10) NOT NULL DEFAULT '1' COMMENT '系统头像ID: 0-自定义',
  `thumb_picid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户头像图片ID',
  `birthyeah` smallint(4) unsigned NOT NULL DEFAULT '0' COMMENT '出生年',
  `birthmonth` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '出生月',
  `birthday` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '出生日',
  `constellation` tinyint(2) NOT NULL DEFAULT '0' COMMENT '星座: 0-未知, 1-摩羯',
  `height` smallint(3) unsigned NOT NULL DEFAULT '0' COMMENT '身高: 单位厘米',
  `weight` smallint(3) unsigned NOT NULL DEFAULT '0' COMMENT '体重: 单位公斤',
  `nationality_id` int(10) NOT NULL DEFAULT '0' COMMENT '国籍ID',
  `lang_cantonese` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否掌握广东话',
  `lang_english` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否掌握英语',
  `birth_city0` int(10) NOT NULL DEFAULT '0' COMMENT '出生地id0',
  `birth_city1` int(10) NOT NULL DEFAULT '0' COMMENT '出生地id1',
  `birth_city2` int(10) NOT NULL DEFAULT '0' COMMENT '出生地id2',
  `live_city0` int(10) NOT NULL DEFAULT '0' COMMENT '居住地id0',
  `live_city1` int(10) NOT NULL DEFAULT '0' COMMENT '居住地id1',
  `live_city2` int(10) NOT NULL DEFAULT '0' COMMENT '居住地id2',
  `live_year` tinyint(2) NOT NULL DEFAULT '0' COMMENT '居住年',
  `phone_validated` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未验证, 1-已验证',
  `idcard_validated` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未验证, 1-已验证',
  `alipay_validated` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未验证, 1-已验证',
  `unionpay_validated` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未验证, 1-已验证',
  `creditcard_validated` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未验证, 1-已验证',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '-7-income_fail收款失败, -6-jd_end接单结束待收款, -5-JD_start接单开始约会计时, -4-JD2接单并到达约会地点, -3-JD1接单并设定约会时间地点, -2-JD0抢单成功, -1-JD等单中, 0-发呆中, 1-XD下单等待中, 2-XD0下单已有人接单, 3-XD1下单并设定约会时间地点, 4-XD_ready下单并到达约会地点, 5-XD_start下单开始约会计时, 6-XD_end下单结束待付款, 7-pay_fail付款失败',
  `permission` tinyint(1) NOT NULL DEFAULT '1' COMMENT '-3-禁止下单和接单, -2-禁止接单, -1-禁止下单, 0-禁止登陆, 1-正常',
  `permission_time` datetime NOT NULL COMMENT '有效期至',
  `rank` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'RANK值,从0到10000',
  `register_time` datetime NOT NULL COMMENT '注册时间',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `phone` (`phone`),
  KEY `gender` (`gender`),
  KEY `status` (`status`),
  KEY `rank` (`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';



# Dump of table member_geo
# ------------------------------------------------------------

DROP TABLE IF EXISTS `member_geo`;

CREATE TABLE `member_geo` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '出没地中心lat',
  `lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '出没地中心lon',
  `rate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '频率',
  `range` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '范围',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `update_time` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户常出现位置表';



# Dump of table member_phone
# ------------------------------------------------------------

DROP TABLE IF EXISTS `member_phone`;

CREATE TABLE `member_phone` (
  `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `phone_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '手机ID',
  `first_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '初次使用时间',
  `last_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后使用时间',
  `days` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用日数',
  PRIMARY KEY (`uid`,`phone_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户和手机的关联表';



# Dump of table notice
# ------------------------------------------------------------

DROP TABLE IF EXISTS `notice`;

CREATE TABLE `notice` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `dateline` datetime NOT NULL COMMENT '提醒日期',
  `male_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '男uid',
  `female_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '女uid',
  `male_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '男lat',
  `male_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '男lon',
  `female_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '女lat',
  `female_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT '女lon',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消费可能性提醒表';



# Dump of table orders
# ------------------------------------------------------------

DROP TABLE IF EXISTS `orders`;

CREATE TABLE `orders` (
  `order_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态',
  `price` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单价,元/小时',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `xd_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单用户ID',
  `jd_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单用户ID',
  `xd_phone_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单phone_id',
  `jd_phone_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '接单phone_id',
  `xd_time` datetime NOT NULL COMMENT '下单时间',
  `xd0_time` datetime NOT NULL COMMENT 'xd0时间',
  `xd1_time` datetime NOT NULL COMMENT 'xd1时间',
  `date_time` datetime NOT NULL COMMENT '预定的约会时间',
  `xd_ready_time` datetime NOT NULL COMMENT 'xd_ready时间',
  `jd_ready_time` datetime NOT NULL COMMENT 'jd_ready时间',
  `jd_start_time` datetime NOT NULL COMMENT 'jd_start时间',
  `jd_end_time` datetime NOT NULL COMMENT 'jd_end时间',
  `pay_time` datetime NOT NULL COMMENT '支付总金额',
  `xd_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd时的latitude',
  `xd_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd时的longitude',
  `jd_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'jd时的latitude',
  `jd_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'jd时的longitude',
  `xd0_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd时的latitude',
  `xd0_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd时的longitude',
  `jd0_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd时的latitude',
  `jd0_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd时的longitude',
  `date_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'date的latitude',
  `date_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'date的longitude',
  `xd_start_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd_start的latitude',
  `xd_start_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd_start的longitude',
  `jd_start_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'jd_start的latitude',
  `jd_start_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'jd_start的longitude',
  `xd_end_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd_end的latitude',
  `xd_end_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'xd_end的longitude',
  `jd_end_lat` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'jd_end的latitude',
  `jd_end_lon` decimal(10,7) NOT NULL DEFAULT '0.0000000' COMMENT 'jd_end的longitude',
  `xd_send_star` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '下单用户发出的评分星级',
  `jd_send_star` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '接单用户发出的评分星级',
  `xd_send_complain_id` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '下单单用户发出的评价ID',
  `jd_send_complain_id` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '接单单用户发出的评价ID',
  `xd_send_comment` varchar(1000) NOT NULL DEFAULT '' COMMENT '下单用户发出的评论',
  `jd_send_comment` varchar(1000) NOT NULL DEFAULT '' COMMENT '接单用户发出的评论',
  PRIMARY KEY (`order_id`),
  KEY `status` (`status`),
  KEY `xd_uid` (`xd_uid`),
  KEY `jd_uid` (`jd_uid`),
  KEY `xd_send_star` (`xd_send_star`),
  KEY `jd_send_star` (`jd_send_star`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单表';



# Dump of table phone
# ------------------------------------------------------------

DROP TABLE IF EXISTS `phone`;

CREATE TABLE `phone` (
  `phone_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '手机ID',
  `os` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未知, 1-iOS, 2-Android',
  `brand_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Brand ID, 1-苹果',
  `model_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Model ID',
  `rom_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'ROM ID, iOS也算是一个ROM',
  `imei` bigint(15) unsigned NOT NULL DEFAULT '0' COMMENT 'IMEI',
  `tac` int(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Type Approval Code是“型号核准号码”,一般代表机型。',
  `mac` bigint(15) unsigned NOT NULL DEFAULT '0' COMMENT 'MAC地址',
  `oui` int(8) unsigned NOT NULL DEFAULT '0' COMMENT 'MAC地址的前3段,可用作表示厂商,如7c:d1:c3是苹果的网卡之一',
  `screen_width` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '屏幕宽度',
  `screen_height` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '屏幕高度',
  `ppi` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'PPI',
  `color` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '0-未知, 1-黑, 2-灰, 3-银, 4-白, 5-咖啡, 6-蓝, 7-绿, 8-橙, 9-黄, 10-金, 11-玫瑰金, 12-紫色, 13-红, 14-粉, 15和以上-其它',
  `capacity` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '容量,单位M',
  `brand` varchar(50) NOT NULL DEFAULT '' COMMENT 'BRAND字符串',
  `model` varchar(50) NOT NULL DEFAULT '' COMMENT 'MODEL字符串',
  `series` varchar(50) NOT NULL DEFAULT '' COMMENT '所属产品线, 如iPhone,iPad,iPad Pro,iPod Touch,iWatch',
  `os_version` varchar(20) NOT NULL DEFAULT '' COMMENT '系统版本号,如4.4.4',
  `rom` varchar(20) NOT NULL DEFAULT '' COMMENT 'ROM名,如Flyme',
  `rom_version` varchar(20) NOT NULL DEFAULT '' COMMENT 'ROM版本,如5.1',
  `language` varchar(20) NOT NULL DEFAULT '' COMMENT '系统语言',
  `contry` varchar(20) NOT NULL DEFAULT '' COMMENT '国家或地区',
  `info` varchar(5000) NOT NULL DEFAULT '' COMMENT '手机信息字符串',
  `app_version` varchar(20) NOT NULL DEFAULT '' COMMENT 'APP版本号',
  `install_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '安装APP次数',
  `uninstall_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '卸载APP次数',
  `member_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用过该手机的用户数',
  `is_shanzhai` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否判断为山寨机',
  `is_simulator` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否判断为模拟器',
  `is_rooted` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否越狱/ROOT',
  `permission` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0-禁止使用, 1-正常',
  `create_time` datetime NOT NULL COMMENT '手机登记时间',
  `update_time` datetime NOT NULL COMMENT '资料更新时间',
  PRIMARY KEY (`phone_id`),
  KEY `os` (`os`),
  KEY `brand_id` (`brand_id`),
  KEY `model_id` (`model_id`),
  KEY `imei` (`imei`),
  KEY `tac` (`tac`),
  KEY `mac` (`mac`),
  KEY `oui` (`oui`),
  KEY `color` (`color`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机表';



# Dump of table phone_brand
# ------------------------------------------------------------

DROP TABLE IF EXISTS `phone_brand`;

CREATE TABLE `phone_brand` (
  `brand` varchar(50) NOT NULL DEFAULT '' COMMENT '收集到的brand',
  `brand_id` int(10) unsigned NOT NULL COMMENT '填写的brand_id',
  `brand_name` int(10) unsigned NOT NULL COMMENT 'brand对应的名称',
  `os` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未知, 1-iOS, 2-Android',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未识别, 1-已识别, 2-自己添加',
  `phone_count` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '登记手机数',
  `series_list` varchar(2000) NOT NULL DEFAULT '' COMMENT '品牌产品线, 一行一个',
  `create_time` datetime NOT NULL COMMENT 'brand登记时间',
  `update_time` datetime NOT NULL COMMENT '资料更新时间',
  PRIMARY KEY (`brand`),
  KEY `brand_id` (`brand_id`),
  KEY `os` (`os`),
  KEY `phone_count` (`phone_count`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机品牌表';



# Dump of table phone_model
# ------------------------------------------------------------

DROP TABLE IF EXISTS `phone_model`;

CREATE TABLE `phone_model` (
  `model` varchar(50) NOT NULL DEFAULT '' COMMENT '收集到的model',
  `model_id` int(10) unsigned NOT NULL COMMENT '填写的model_id',
  `model_name` int(10) unsigned NOT NULL COMMENT 'model对应的名称',
  `brand_id` int(10) unsigned NOT NULL COMMENT '所属brand_id',
  `series` varchar(50) NOT NULL DEFAULT '' COMMENT '所属产品线',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未识别, 1-已识别, 2-自己添加',
  `phone_count` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '登记手机数',
  `create_time` datetime NOT NULL COMMENT 'model登记时间',
  `update_time` datetime NOT NULL COMMENT '资料更新时间',
  PRIMARY KEY (`model`),
  KEY `model_id` (`model_id`),
  KEY `brand_id` (`brand_id`),
  KEY `phone_count` (`phone_count`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机型号表';



# Dump of table phone_oui
# ------------------------------------------------------------

DROP TABLE IF EXISTS `phone_oui`;

CREATE TABLE `phone_oui` (
  `oui` int(8) unsigned NOT NULL DEFAULT '0' COMMENT 'MAC地址的前3段,可用作表示厂商,如7c:d1:c3是苹果的网卡之一',
  `brand_id` int(10) unsigned NOT NULL COMMENT '所属brand_id',
  `model_id` int(10) unsigned NOT NULL COMMENT '所属model_id',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未识别, 1-已识别, 2-自己添加',
  `phone_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登记手机数',
  `create_time` datetime NOT NULL COMMENT 'model登记时间',
  `update_time` datetime NOT NULL COMMENT '资料更新时间',
  PRIMARY KEY (`oui`),
  KEY `model_id` (`model_id`),
  KEY `brand_id` (`brand_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机OUI表';



# Dump of table phone_tac
# ------------------------------------------------------------

DROP TABLE IF EXISTS `phone_tac`;

CREATE TABLE `phone_tac` (
  `tac` int(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Type Approval Code是“型号核准号码”,一般代表机型。',
  `brand_id` int(10) unsigned NOT NULL COMMENT '所属brand_id',
  `model_id` int(10) unsigned NOT NULL COMMENT '所属model_id',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-未识别, 1-已识别, 2-自己添加',
  `phone_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登记手机数',
  `create_time` datetime NOT NULL COMMENT 'model登记时间',
  `update_time` datetime NOT NULL COMMENT '资料更新时间',
  PRIMARY KEY (`tac`),
  KEY `model_id` (`model_id`),
  KEY `brand_id` (`brand_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机TAC表';



# Dump of table posts
# ------------------------------------------------------------

DROP TABLE IF EXISTS `posts`;

CREATE TABLE `posts` (
  `uid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `content` varchar(255) DEFAULT NULL,
  `catetory` varchar(255) DEFAULT NULL,
  `tag` varchar(255) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `pid` int(11) DEFAULT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

LOCK TABLES `posts` WRITE;
/*!40000 ALTER TABLE `posts` DISABLE KEYS */;

INSERT INTO `posts` (`uid`, `title`, `time`, `content`, `catetory`, `tag`, `type`, `pid`)
VALUES
    (1,'dsfsdf','2015-09-11 00:21:21','sdfsdf','sdfsd','1',1,1),
    (2,'似懂非懂','2015-09-11 00:21:21','22','2323岁的身份','1',1,1);

/*!40000 ALTER TABLE `posts` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table relation_date
# ------------------------------------------------------------

DROP TABLE IF EXISTS `relation_date`;

CREATE TABLE `relation_date` (
  `xd_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD用户ID',
  `jd_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD用户ID',
  `first_xd0` datetime NOT NULL COMMENT '初次xd0',
  `last_xd0` datetime NOT NULL COMMENT '最后xd0',
  `xd0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'xd0次数',
  `pay` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '完整pay次数',
  `pay_amount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付总金额',
  `pay_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '平均支付金额',
  `date_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总相处秒数',
  `xd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出1星数',
  `xd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出2星数',
  `xd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出3星数',
  `xd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出4星数',
  `xd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD发出5星数',
  `xd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'XD平均发出星数',
  `jd_send_star1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出1星数',
  `jd_send_star2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出2星数',
  `jd_send_star3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出3星数',
  `jd_send_star4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出4星数',
  `jd_send_star5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD发出5星数',
  `jd_send_star_average` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'JD平均发出星数',
  PRIMARY KEY (`xd_uid`,`jd_uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户通过约会建立的关系';



# Dump of table relation_notice
# ------------------------------------------------------------

DROP TABLE IF EXISTS `relation_notice`;

CREATE TABLE `relation_notice` (
  `male_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '男uid',
  `female_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '女uid',
  `last_notice` datetime NOT NULL COMMENT '最后提醒日期',
  `notice_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提醒次数',
  PRIMARY KEY (`male_uid`,`female_uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='通过地理位置和消费可能性建立的关系';



# Dump of table users
# ------------------------------------------------------------

DROP TABLE IF EXISTS `users`;

CREATE TABLE `users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `fullname` varchar(255) DEFAULT NULL,
  `cpassword` varchar(255) DEFAULT NULL,
  `nickname` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;

INSERT INTO `users` (`id`, `username`, `password`, `email`, `fullname`, `cpassword`, `nickname`)
VALUES
    (1,'tom','q57DLEoOsX.0c064f9a9404fda77aa3bebf6422a7fe','[email protected]','甄超文',NULL,'sss'),
    (2,'lihua','KTEkoogASF.7d2e4d24b7c4d2cb2a81efb8c7894122','[email protected]','李华',NULL,'sss'),
    (3,'liming','KTf5SR4C3K.4a0b355eb271b115d8e2346ac845ae17','[email protected]','黎明',NULL,'ss'),
    (4,'lim2','0gYctpzTCt.830fbab89ffe410549d465833ecdf596','[email protected]','黎明2',NULL,'sss'),
    (5,'[email protected]','Rd22daC3RW.d34ac8c3158c3db05f41a1c31c0bca73','[email protected]','利马',NULL,'sss'),
    (6,'pwddd','gVCHF2OOu8.93ab3f7954cef1f885abf3bfb07b0ec1','[email protected]','zzzzz',NULL,'李大哈等等');

/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table w_area
# ------------------------------------------------------------

DROP TABLE IF EXISTS `w_area`;

CREATE TABLE `w_area` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `country_name` varchar(255) DEFAULT NULL COMMENT '国家名称',
  `country_code` int(11) DEFAULT NULL COMMENT '国家编号',
  `province_name` varchar(255) DEFAULT NULL COMMENT '省份名称',
  `province_code` int(11) DEFAULT NULL COMMENT '省份编号',
  `city_name` varchar(255) DEFAULT NULL COMMENT '城市名称',
  `city_code` int(11) DEFAULT NULL COMMENT '城市编号',
  `longitude` float DEFAULT NULL COMMENT '经度',
  `latitude` float DEFAULT NULL COMMENT '纬度',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8;

LOCK TABLES `w_area` WRITE;
/*!40000 ALTER TABLE `w_area` DISABLE KEYS */;

INSERT INTO `w_area` (`id`, `country_name`, `country_code`, `province_name`, `province_code`, `city_name`, `city_code`, `longitude`, `latitude`)
VALUES
    (1,'中国',1001,'广东',1001001,'广州',1001001001,33.1,221.1),
    (2,'中国',1001,'广东',1001001,'深圳',1001001002,32.1,241.1),
    (3,'中国',1001,'广东',1001001,'佛山',1001001002,32.1,241.1),
    (4,'中国',1001,'广东',1001001,'东莞',1001001002,32.1,241.1),
    (5,'中国',1001,'广东',1001001,'珠海',1001001002,32.1,241.1),
    (6,'中国',1001,'广东',1001001,'江门',1001001002,32.1,241.1),
    (7,'中国',1001,'广东',1001001,'汕头',1001001002,32.1,241.1),
    (8,'中国',1001,'广东',1001001,'韶关',1001001002,32.1,241.1),
    (9,'中国',1001,'广东',1001001,'清远',1001001002,32.1,241.1),
    (10,'中国',1001,'广东',1001001,'中山',1001001002,32.1,241.1),
    (11,'中国',1001,'广东',1001001,'湛江',1001001002,32.1,241.1),
    (12,'中国',1001,'广东',1001001,'开平',1001001002,32.1,241.1),
    (13,'中国',1001,'广东',1001001,'台山',1001001002,32.1,241.1),
    (14,'中国',1001,'广东',1001001,'恩平',1001001002,32.1,241.1),
    (15,'中国',1001,'广东',1001001,'三水',1001001002,32.1,241.1),
    (16,'aa',1,'ads',1,'sada',1,11,111),
    (17,'aa',1,'ads',1,'sada',1,11,111),
    (18,'q1',1,'11',1,'11',1,11,1),
    (19,'ddd1121',1,'ddd12',1,'dd112',1,11,11),
    (20,'ww',1,'ww',11,'ww',11,12,1),
    (21,'',0,'',0,'',0,0,0),
    (22,'我去玩',1,'',1,'',1,1,1);

/*!40000 ALTER TABLE `w_area` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table w_domain
# ------------------------------------------------------------

DROP TABLE IF EXISTS `w_domain`;

CREATE TABLE `w_domain` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL COMMENT '域名名称',
  `count` int(11) DEFAULT NULL COMMENT '搜索次数',
  `proportion` int(11) DEFAULT NULL COMMENT '占比',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

LOCK TABLES `w_domain` WRITE;
/*!40000 ALTER TABLE `w_domain` DISABLE KEYS */;

INSERT INTO `w_domain` (`id`, `name`, `count`, `proportion`)
VALUES
    (1,'m.baidu.com\n',33333,12),
    (2,'www.baidu.com\n',3223,12),
    (3,'www.mafengwo.cn\n',4212,11),
    (4,'www.mafengwo.cn\n',343,11),
    (5,'m5.baidu.com\n',343,23),
    (6,'www.haosou.com\n',2222,11),
    (7,'wap.sogou.com\n',2222,1),
    (8,'cn.bing.com\n',221,2),
    (9,'z.mafengwo.cn\n',22,1),
    (10,'z.mafengwo.cn\n',22,2);

/*!40000 ALTER TABLE `w_domain` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table w_page
# ------------------------------------------------------------

DROP TABLE IF EXISTS `w_page`;

CREATE TABLE `w_page` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL COMMENT '受访页面名称',
  `count` int(11) DEFAULT NULL COMMENT '搜索次数',
  `proportion` int(11) DEFAULT NULL COMMENT '占比',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

LOCK TABLES `w_page` WRITE;
/*!40000 ALTER TABLE `w_page` DISABLE KEYS */;

INSERT INTO `w_page` (`id`, `name`, `count`, `proportion`)
VALUES
    (1,'http://huoche.mafengwo.cn/\n',23333,12),
    (2,'http://huoche.mafengwo.cn/skb/\n',211213,112),
    (3,'http://huoche.mafengwo.cn/ysq/\n',5677,22),
    (4,'http://huoche.mafengwo.cn/yss/\n',99,9),
    (5,'http://huoche.mafengwo.cn/22/n',655654,8),
    (6,'http://huoche.mafengwo.cn/223/\n',4546,2),
    (7,'http://huoche.mafengwo.cn/22232/\n',345,2),
    (8,'http://huoche.mafengwo.cn/222/\n',764,1),
    (9,'http://huoche.mafengwo.cn/22312/\n',9443,2),
    (10,'http://huoche.mafengwo.cn/31212/\n',542,23);

/*!40000 ALTER TABLE `w_page` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table w_survey
# ------------------------------------------------------------

DROP TABLE IF EXISTS `w_survey`;

CREATE TABLE `w_survey` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `create_date` date DEFAULT NULL COMMENT '创建时间',
  `pv` int(11) DEFAULT NULL COMMENT 'pv',
  `uv` int(11) DEFAULT NULL COMMENT 'uv',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

LOCK TABLES `w_survey` WRITE;
/*!40000 ALTER TABLE `w_survey` DISABLE KEYS */;

INSERT INTO `w_survey` (`id`, `create_date`, `pv`, `uv`)
VALUES
    (1,'2015-12-12',34,3455),
    (2,'2015-12-01',324,111),
    (3,'2015-12-02',331,232),
    (4,'2015-12-03',342,333),
    (5,'2015-12-04',343,345),
    (6,'2015-12-06',453,566),
    (7,'2015-12-07',543,765);

/*!40000 ALTER TABLE `w_survey` ENABLE KEYS */;
UNLOCK TABLES;


# Dump of table w_sword
# ------------------------------------------------------------

DROP TABLE IF EXISTS `w_sword`;

CREATE TABLE `w_sword` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL COMMENT '关键词名称',
  `count` int(11) DEFAULT NULL COMMENT '搜索次数',
  `proportion` int(11) DEFAULT NULL COMMENT '占比',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

LOCK TABLES `w_sword` WRITE;
/*!40000 ALTER TABLE `w_sword` DISABLE KEYS */;

INSERT INTO `w_sword` (`id`, `name`, `count`, `proportion`)
VALUES
    (1,'黔江站车次\n',33333,14),
    (2,'k1258次列车经过路线\n',3223,16),
    (3,'火车禄丰县最远到什么地方\n',4212,16),
    (4,'火车禄丰县最远到什么地方\n',343,12),
    (5,'公主岭至北戴河列车表\n',343,13),
    (6,'代县到沈阳火车1173次\n',2222,14),
    (7,'北京到丹东火车车次\n',2222,11),
    (8,'北京到丹东火车车次\n',221,9),
    (9,'佳木斯至盘锦到四平几点\n',22,2),
    (10,'福安到黄山\n',22,1);

/*!40000 ALTER TABLE `w_sword` ENABLE KEYS */;
UNLOCK TABLES;



/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
View Code

其实里面比较多无关的表,我也懒得删了,看官自己看着办吧,现在写博文也懒惰了不少了。

第二步数据库配置:

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
|    ['hostname'] The hostname of your database server.
|    ['username'] The username used to connect to the database
|    ['password'] The password used to connect to the database
|    ['database'] The name of the database you want to connect to
|    ['dbdriver'] The database type. ie: mysql.  Currently supported:
                 mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
|    ['dbprefix'] You can add an optional prefix, which will be added
|                 to the table name when using the  Active Record class
|    ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
|    ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
|    ['cache_on'] TRUE/FALSE - Enables/disables query caching
|    ['cachedir'] The path to the folder where cache files should be stored
|    ['char_set'] The character set used in communicating with the database
|    ['dbcollat'] The character collation used in communicating with the database
|                 NOTE: For MySQL and MySQLi databases, this setting is only used
|                  as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
|                 (and in table creation queries made with DB Forge).
|                  There is an incompatibility in PHP with mysql_real_escape_string() which
|                  can make your site vulnerable to SQL injection if you are using a
|                  multi-byte character set and are running versions lower than these.
|                  Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
|    ['swap_pre'] A default table prefix that should be swapped with the dbprefix
|    ['autoinit'] Whether or not to automatically initialize the database.
|    ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
|                            - good for ensuring strict SQL while developing
|
| The $active_group variable lets you choose which connection group to
| make active.  By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/

$active_group = 'default';
$active_record = TRUE;

//出租屋
$db['default']['hostname'] = '192.168.1.109';
$db['default']['username'] = 'zhenchaowen';
$db['default']['password'] = 'zhenchaowen';
$db['default']['database'] = 'howframework';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;


//公司



/* End of file database.php */
/* Location: ./application/config/database.php */
View Code

数据库我是放到本地的虚拟机上面,实在也没钱买阿里的云服务。。。不过这样子我的Mac电脑干干净净的

第三步骤就是相关代码编写了:

CI帮助我们把MVC给分离了,我们就可以直接在上面写我们的Model层,View层,Control层

Model层例子如下:

<?php

class W_area_model extends CI_Model {
  public function __construct() {
    $this->load->database();
  }

  public function create_area() {
  
    $data = array(
      'country_name' => $this->input->post('country_name'),
      'country_code' => $this->input->post('country_code'),
      'province_name' => $this->input->post('province_name'),
      'province_code' => $this->input->post('province_code'),
      'city_name' => $this->input->post('city_name'),
      'city_code' => $this->input->post('city_code'),
      'longitude' => $this->input->post('longitude'),
      'latitude' => $this->input->post('latitude')
    );

    return $this->db->insert('w_area',$data);
  }

  public function get_list_area($p = FALSE) {
    $this->db->select('*');
    $this->db->from('w_area');
    $this->db->order_by('id desc');

    if($p === FALSE) {
      $this->db->limit(10);
    } else {
      $this->db->limit($p*10+10,$p*10);
    }

    $query = $this->db->get();
    return $query->result();
  }

  public function delete_area() {
    $id = $this->input->post('id');
    return $this->db->delete('w_area',array('id'=>$id));
  }

} 
View Code

View层例子如下:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>HowFrameWork</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <link href="<?php echo base_url('css/bootstrap.css');?>" rel="stylesheet">
        <link href="<?php echo base_url('css/style.css');?>" rel="stylesheet">

        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        
    </head>

    <body>
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <div class="nav-collapse">
                        <ul class="nav">
                            <li class="active"><a href="#">Home</a></li>
                            <li><a href="#about">About</a></li>
                            <li><a href="#contact">Contact</a></li>
                        </ul>
                    </div><!--/.nav-collapse -->
                    
          <div class="btn-group pull-right">
            <a class="btn" href="<?php echo site_url('login'); ?>">
              <i class="icon-user"></i> Login
              <span class="caret"></span>
            </a>
          </div>                    
                    
                </div>
            </div>
        </div>

        <header>
            <div class="container">
                <div class="row">
                    <div class="span6">
                        <h1>This is my header</h1>
                        <p>This is my site slogan</p>
                    </div>
                    <div class="span6">
                        <p>Proin id libero molestie ante faucibus tincidunt sit amet ac nisi. Mauris feugiat ultricies magna eu laoreet. Nunc tincidunt tempus leo vitae gravida.
                        </p>
                </div>
            </div>
        </header>

        <div id="body">
            <div class="container">
                <div class="row">
                    <div id="content" class="span8">
                        <ul class="posts">
                            <li class="post">
                                <h2>Praesent laoreet elit vel augue porttitor eu adipiscing risus egestas</h2>
                                <div class="meta">April 19, 2012 12:00 am</div>
                                <div class="entry">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce posuere nisl a sem scelerisque fermentum. Fusce semper tempor lacinia. Nam dictum aliquet dictum. Ut sit amet lorem ante, a pulvinar sapien. Nam pharetra aliquet vestibulum. In cursus hendrerit purus, ut iaculis lacus vehicula vel. Duis varius, leo eu facilisis fringilla, nibh lacus mollis libero, a fringilla tortor elit non dui. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec a odio in mi rutrum lacinia. Ut eget elit a magna gravida pretium. Quisque sed turpis nisl. Praesent commodo malesuada egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae</p>

                                    <p>Praesent laoreet elit vel augue porttitor eu adipiscing risus egestas. Donec luctus ligula nec tortor porta ut sodales neque ultrices. Sed rhoncus metus non est ullamcorper aliquet. Morbi eu blandit nibh. Donec dictum iaculis diam nec pulvinar. Morbi auctor hendrerit aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
                                </div>
                                <a href="#">Read More</a>
                            </li>
                            <li class="post">
                                <h2>Praesent laoreet elit vel augue porttitor eu adipiscing risus egestas</h2>
                                <div class="meta">April 19, 2012 12:00 am</div>
                                <div class="entry">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce posuere nisl a sem scelerisque fermentum. Fusce semper tempor lacinia. Nam dictum aliquet dictum. Ut sit amet lorem ante, a pulvinar sapien. Nam pharetra aliquet vestibulum. In cursus hendrerit purus, ut iaculis lacus vehicula vel. Duis varius, leo eu facilisis fringilla, nibh lacus mollis libero, a fringilla tortor elit non dui. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec a odio in mi rutrum lacinia. Ut eget elit a magna gravida pretium. Quisque sed turpis nisl. Praesent commodo malesuada egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae</p>

                                    <p>Praesent laoreet elit vel augue porttitor eu adipiscing risus egestas. Donec luctus ligula nec tortor porta ut sodales neque ultrices. Sed rhoncus metus non est ullamcorper aliquet. Morbi eu blandit nibh. Donec dictum iaculis diam nec pulvinar. Morbi auctor hendrerit aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
                                </div>
                                <a href="#">Read More</a>
                            </li>
                            <li class="post">
                                <h2>Praesent laoreet elit vel augue porttitor eu adipiscing risus egestas</h2>
                                <div class="meta">April 19, 2012 12:00 am</div>
                                <div class="entry">
                                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce posuere nisl a sem scelerisque fermentum. Fusce semper tempor lacinia. Nam dictum aliquet dictum. Ut sit amet lorem ante, a pulvinar sapien. Nam pharetra aliquet vestibulum. In cursus hendrerit purus, ut iaculis lacus vehicula vel. Duis varius, leo eu facilisis fringilla, nibh lacus mollis libero, a fringilla tortor elit non dui. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec a odio in mi rutrum lacinia. Ut eget elit a magna gravida pretium. Quisque sed turpis nisl. Praesent commodo malesuada egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae</p>

                                    <p>Praesent laoreet elit vel augue porttitor eu adipiscing risus egestas. Donec luctus ligula nec tortor porta ut sodales neque ultrices. Sed rhoncus metus non est ullamcorper aliquet. Morbi eu blandit nibh. Donec dictum iaculis diam nec pulvinar. Morbi auctor hendrerit aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
                                </div>
                                <a href="#">Read More</a>
                            </li>

                        </ul>
                    </div>
                    <div id="sidebar" class="span4">
                        <div class="widget">
                            Praesent laoreet elit vel augue porttitor eu adipiscing risus egestas. Donec luctus ligula nec tortor porta ut sodales neque ultrices. Sed rhoncus metus non est ullamcorper aliquet. Morbi eu blandit nibh. Donec dictum iaculis diam nec pulvinar. Morbi auctor hendrerit aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <footer>
            <div class="container">
                <div class="row">
                    <div class="span6">&copy; Copyright 2012</div>
                    <div class="span6"></div>
                </div>
            </div>
        </footer>
        <!-- JS -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="<?php echo base_url('js/bootstrap.min.js');?>"></script>
    </body>
</html>
View Code

Control层

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Area extends CI_Controller {
    var $data = array();

    function __construct()
    {
        // Call the Controller constructor
        parent::__construct();
        
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header("Cache-Control: no-store, no-cache, must-revalidate");
        header("Cache-Control: post-check=0, pre-check=0", false);
        header("Pragma: no-cache");        
        
        $this->load->model('m_user');
        
        if ($this->m_user->is_logged_in() === FALSE) { 
            $this->m_user->remove_pass();
            redirect('login/noaccess');
        } else {
            // is_logged_in also put user data in session
            $this->data['user'] = $this->session->userdata('user');
        }

    }

    // public function index()
    // {
    //     $this->load->view('admin/v_admin_home', $this->data);
    // }
    public function index($p = FALSE)
      { 
        $this->load->model('w_area_model');
          if($p === FALSE) {
              $this->data['w_area'] = $this->w_area_model->get_list_area();
               $this->data['current_page'] = 0;
        } else {
              $this->data['w_area'] = $this->w_area_model->get_list_area($p);
            $this->data['current_page'] = $p;
            }
      $this->load->view('area/v_area_home',$this->data);
   }

   public function add_area()
    { 
      $this->load->model('w_area_model');
       $this->w_area_model->create_area();
       $this->data['w_area'] = $this->w_area_model->get_list_area();
       $this->load->view('area/v_area_home',$this->data);
   }

   public function del_area()
    { 
      $this->load->model('w_area_model');
      $this->w_area_model->delete_area();
      $this->data['w_area'] = $this->w_area_model->get_list_area();
      $this->load->view('area/v_area_home',$this->data);
   }

}

/* End of file admin.php */
/* Location: ./application/controllers/admin.php */
View Code

访问:

http://mysites:8405/CodeIgniter-master/index.php/admin/

我们就可以看到上图展示的效果;

github分享:https://github.com/super-d2/codeigniter_demo(备注比较多无关的东西,没太多时间去清理)

开发环境搭建:http://www.cnblogs.com/super-d2/p/5008934.html

更改默认不支持get的方法:http://stackoverflow.com/questions/2043070/enabling-get-in-codeigniter

 

你可能感兴趣的:(php开发(CI框架使用))