text: CREATE TABLE IF NOT EXISTS `wp_tmplmsg` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `openid`  varchar(255) NOT NULL  COMMENT 'openid',
  `template_id`  varchar(500) NOT NULL  COMMENT '模板ID',
  `message`  text NOT NULL  COMMENT '消息内容',
  `MsgID`  varchar(255) NOT NULL  COMMENT '消息ID',
  `sendstatus`  char(50) NOT NULL  COMMENT '发送状态',
  `Status`  char(50) NOT NULL  COMMENT '送达报告',
  `token`  varchar(255) NOT NULL  COMMENT 'token',
  `ctime`  int(10) NOT NULL  COMMENT '发送时间',
  `group`  varchar(50) NOT NULL  DEFAULT 'qujiang' COMMENT '园区组号',
  `p_name`  varchar(100) NOT NULL  DEFAULT 'none' COMMENT '家长名称',
  `c_name`  varchar(100) NOT NULL  DEFAULT 'none' COMMENT '孩子名称',
  `kq_status`  char(50) NOT NULL  COMMENT '考勤状态',
  PRIMARY KEY (`id`)
  ) ENGINE=MyISAM DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci CHECKSUM=0 ROW_FORMAT=DYNAMIC DELAY_KEY_WRITE=0;
  INSERT INTO `wp_tmplmsg` (`id`,`openid`,`template_id`,`message`,`MsgID`,`sendstatus`,`Status`,`token`,`ctime`,`group`,`p_name`,`c_name`,`kq_status`) VALUES ('3','o0N6jtwUl-JZaGFWXyDIVpJ1NKOc','bt69RCmQK1OELk_1bUImRslcvEWX87oGiRhUpc2S0PA','{"w":"1"}','211093070','0','','gh_70ef53d6dbc1','1437131219','qujiang','none','none','');
  INSERT INTO `wp_model` (`name`,`title`,`extend`,`relation`,`need_pk`,`field_sort`,`field_group`,`attribute_list`,`template_list`,`template_add`,`template_edit`,`list_grid`,`list_row`,`search_key`,`search_list`,`create_time`,`update_time`,`status`,`engine_type`) VALUES ('tmplmsg','模板消息','0','','1','{"1":["openid","template_id","message","MsgID","sendstatus","Status","ctime","group","p_name","c_name","kq_status"]}','1:基础','','','','','id:ID\r\nc_name:孩子名称\r\np_name:家长名称\r\nopenid:OPENID\r\ngroup:园区\r\nsendstatus|get_name_by_status:发送状态\r\nkq_status:考勤状态\r\nctime|time_format:考勤时间\r\ntoken:token\r\nid:操作:[DELETE]|删除','10','openid','','1409247434','1437698187','1','MyISAM');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('openid','openid','varchar(255) NOT NULL','string','','','1','','0','0','1','1409247462','1409247462','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('template_id','模板ID','varchar(500) NOT NULL','string','','','1','','0','0','1','1409247489','1409247489','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('message','消息内容','text NOT NULL','textarea','','','1','','0','0','1','1409247512','1409247512','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('MsgID','消息ID','varchar(255) NOT NULL','string','','','1','','0','0','1','1409247552','1409247552','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sendstatus','发送状态','char(50) NOT NULL','select','','','1','0:成功\r\n1:失败','0','0','1','1409247862','1409247608','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('Status','送达报告','char(50) NOT NULL','select','','','1','0:成功\r\n1:失败：用户拒收\r\n2:失败：其他原因','0','0','1','1409247873','1409247697','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('token','token','varchar(255) NOT NULL','string','','','0','','0','0','1','1409247732','1409247713','','3','','regex','get_token','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('ctime','发送时间','int(10) NOT NULL','datetime','','','1','','0','0','1','1409247759','1409247759','','3','','regex','time','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('group','园区组号','varchar(50) NOT NULL','string','qujiang','园区组号','1','','0','0','1','1437139006','1437139006','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('p_name','家长名称','varchar(100) NOT NULL','string','none','','1','','0','0','1','1437143159','1437143159','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('c_name','孩子名称','varchar(100) NOT NULL','string','none','','1','','0','0','1','1437143688','1437143688','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('kq_status','考勤状态','char(50) NOT NULL','select','','','1','0:未知\r\n1:到校\r\n2:离校','0','0','1','1437144072','1437144072','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;