text: CREATE TABLE IF NOT EXISTS `wp_shop` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title`  varchar(255) NOT NULL  COMMENT '商店名称',
  `logo`  int(10) NULL  COMMENT '商店LOGO',
  `intro`  text NULL  COMMENT '店铺简介',
  `mobile`  varchar(30) NULL  COMMENT '联系电话',
  `qq`  int(10) NULL  COMMENT 'QQ',
  `wechat`  varchar(50) NULL  COMMENT '微信',
  `template`  varchar(30) NULL  COMMENT '模板',
  `content`  text  NULL  COMMENT '店铺介绍',
  `token`  varchar(100) NULL  COMMENT 'Token',
  `manager_id`  int(10) NULL  COMMENT '管理员ID',
  `api_key`  varchar(100) NULL  COMMENT '快递接口的APPKEY',
  `parent_shop`  varchar(255) NULL  COMMENT '分销上级商店',
  `address`  varchar(255) NULL  COMMENT '详细地址',
  `gps`  varchar(55) NULL  COMMENT 'GPS经纬度',
  `custom_tip`  text 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_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`,`addon`) VALUES ('shop','微商城','0','','1','["title","logo","intro","mobile","qq","wechat","api_key","custom_tip","content","address","gps"]','1:基础','','','','','title:商店名称\r\nlogo|get_img_html:商店LOGO\r\nmobile:联系电话\r\nqq:QQ号\r\nwechat:微信号\r\nids:操作:[EDIT]&id=[id]|编辑,lists&_controller=Category&target=_blank&shop_id=[id]|商品分类,lists&_controller=Slideshow&target=_blank&shop_id=[id]|幻灯片,lists&_controller=Goods&target=_blank&shop_id=[id]|商品管理,lists&_controller=Order&target=_blank&shop_id=[id]|订单管理,lists&_addons=Payment&_controller=Payment&target=_blank&shop_id=[id]|支付配置,lists&_controller=Template&target=_blank&shop_id=[id]|模板选择,[DELETE]|删除,index&_controller=Wap&target=_blank&shop_id=[id]|预览','20','title:请输入商店名称','','1422670956','1458268970','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','商店名称','varchar(255) NOT NULL','string','','','1','','0','shop','1','1','1422671603','1422671261','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('logo','商店LOGO','int(10) NULL','picture','','建议上传100X100的正方形图片','1','','0','shop','0','1','1476361627','1422671295','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('intro','店铺简介','text NULL','textarea','','','1','','0','shop','0','1','1422671570','1422671345','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('mobile','联系电话','varchar(30) NULL','string','','','1','','0','shop','0','1','1422671410','1422671410','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('qq','QQ','int(10) NULL','num','','','1','','0','shop','0','1','1422671498','1422671498','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('wechat','微信','varchar(50) NULL','string','','','1','','0','shop','0','1','1422671544','1422671544','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('template','模板','varchar(30) NULL','string','','','0','','0','shop','0','1','1422950165','1422950165','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('content','店铺介绍','text  NULL','editor','','','0','','0','shop','0','1','1476343853','1423108654','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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(100) NULL','string','','','0','','0','shop','0','1','1439456512','1439455806','','3','','regex','get_token','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('manager_id','管理员ID','int(10) NULL','num','','','0','','0','shop','0','1','1439456496','1439455828','','3','','regex','get_mid','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('api_key','快递接口的APPKEY','varchar(100) NULL','string','','申请地址：http://www.juhe.cn/docs/api/id/43','1','','0','shop','0','1','1449642784','1440558965','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('parent_shop','分销上级商店','varchar(255) NULL','string','','','0','','0','shop','0','1','1441937801','1441620588','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('address','详细地址','varchar(255) NULL','string','','','1','','0','shop','1','1','1467199852','1444616843','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('gps','GPS经纬度','varchar(55) NULL','string','','（请点击地图，然后拖动图标到你的位置上）','1','','0','shop','0','1','1444617275','1444616886','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('custom_tip','联系客服提示内容','text NULL','textarea','','底部导航联系客服的提示内容','1','','0','shop','0','1','1458268873','1458268792','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_address` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uid`  int(10) NULL  COMMENT '用户ID',
  `truename`  varchar(100) NULL  COMMENT '收货人姓名',
  `mobile`  varchar(50) NULL  COMMENT '手机号码',
  `city`  varchar(255) NULL  COMMENT '城市',
  `address`  varchar(255) NULL  COMMENT '具体地址',
  `is_use`  tinyint(2) NULL  DEFAULT 0 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_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`,`addon`) VALUES ('shop_address','收货地址','0','','1','','1:基础','','','','','','20','','','1423477477','1423477477','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户ID','int(10) NULL','num','','','0','','0','shop_address','1','1','1429522999','1423477509','','3','','regex','get_mid','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('truename','收货人姓名','varchar(100) NULL','string','','','1','','0','shop_address','1','1','1423477690','1423477548','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('mobile','手机号码','varchar(50) NULL','string','','','1','','0','shop_address','1','1','1423477580','1423477580','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('city','城市','varchar(255) NULL','cascade','','','1','module=city','0','shop_address','1','1','1423477660','1423477660','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('address','具体地址','varchar(255) NULL','string','','','1','','0','shop_address','1','1','1423477681','1423477681','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_use','是否设置为默认','tinyint(2) NULL','bool','0','','1','0:否\r\n1:是','0','shop_address','0','1','1423536697','1423477729','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_cart` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uid`  int(10) UNSIGNED NOT NULL  COMMENT '用户ID',
  `shop_id`  varchar(255) NOT NULL  COMMENT '商店id',
  `goods_id`  varchar(255) NOT NULL  COMMENT '商品id',
  `num`  int(10) UNSIGNED NULL  COMMENT '数量',
  `price`  varchar(30) NULL  COMMENT '单价',
  `goods_type`  tinyint(2) NULL  DEFAULT 0 COMMENT '商品类型',
  `openid`  varchar(255) NULL  COMMENT 'openid',
  `spec_option_ids`  varchar(50) NULL  COMMENT '商品SKU',
  `cTime`  int(10) NULL  COMMENT '创建时间',
  `lock_rid_num`  int(10) NULL  DEFAULT 0 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_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`,`addon`) VALUES ('shop_cart','购物车','0','','1','','1:基础','','','','','','20','','','1419577864','1419577864','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户ID','int(10) UNSIGNED NOT NULL','num','','','0','','0','shop_cart','0','1','1419577913','1419577913','','3','','regex','get_mid','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商店id','varchar(255) NOT NULL','string','','','0','','0','shop_cart','0','1','1419578098','1419577949','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品id','varchar(255) NOT NULL','string','','','0','','0','shop_cart','0','1','1419578025','1419578025','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('num','数量','int(10) UNSIGNED NULL','num','','','1','','0','shop_cart','0','1','1442375501','1419578075','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('price','单价','varchar(30) NULL','num','','','0','','0','shop_cart','0','1','1442375464','1419578154','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_type','商品类型','tinyint(2) NULL','bool','0','','1','','0','shop_cart','0','1','1442375477','1420551825','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_cart','0','1','1442375487','1420195356','','3','','regex','get_openid','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('spec_option_ids','商品SKU','varchar(50) NULL','string','','','0','','0','shop_cart','0','1','1442630926','1442630926','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','0','','0','shop_cart','0','1','1450231548','1450231541','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('lock_rid_num','释放库存数','int(10) NULL','num','0','','1','','0','shop_cart','0','1','1457002922','1457002911','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_collect` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uid`  int(10) NULL  COMMENT '使用UID',
  `goods_id`  int(10) NULL  COMMENT '商品ID',
  `cTime`  int(10) 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_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`,`addon`) VALUES ('shop_collect','商品收藏','0','','1','','1:基础','','','','','','20','','','1423471275','1423471275','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','使用UID','int(10) NULL','num','','','0','','0','shop_collect','0','1','1423471296','1423471296','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品ID','int(10) NULL','num','','','0','','0','shop_collect','0','1','1423471321','1423471321','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','0','','0','shop_collect','0','1','1423471348','1423471348','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `cover`  int(10) UNSIGNED NULL  COMMENT '商品封面图',
  `content`  text NULL  COMMENT '商品介绍',
  `title`  varchar(255) NOT NULL  COMMENT '商品名称',
  `market_price`  decimal(10,2) NULL  DEFAULT 0 COMMENT '市场价',
  `imgs`  varchar(255) NULL  COMMENT '商品图片',
  `stock_num`  int(10) NULL  DEFAULT 0 COMMENT '库存数量',
  `shop_id`  int(10) NULL  DEFAULT 0 COMMENT '商店ID',
  `is_show`  tinyint(2) NULL  DEFAULT 2 COMMENT '是否上架',
  `sale_count`  int(10) NULL  DEFAULT 0 COMMENT '销售量',
  `is_recommend`  tinyint(2) NULL  COMMENT '是否推荐',
  `rank`  int(10) NULL  DEFAULT 0 COMMENT '热销度',
  `show_time`  int(10) NULL  DEFAULT 0 COMMENT '上架时间',
  `cost_price`  decimal(10,2) NULL  DEFAULT 0 COMMENT '成本价',
  `type`  tinyint(2) NULL  DEFAULT 0 COMMENT '商品类型',
  `category_id`  char(50) NULL  COMMENT '商品分类',
  `auto_send`  char(10) NULL  DEFAULT 0 COMMENT '自动发货',
  `virtual_textarea`  text NULL  COMMENT '虚拟物品信息',
  `token`  varchar(255) NULL  COMMENT 'token',
  `sale_price`  float(10) NULL  COMMENT '促销价',
  `weight`  float(10) NULL  COMMENT '重量',
  `sn_code`  text NULL  COMMENT '商品编号',
  `extra_int_1`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_0`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_2`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_3`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_4`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_5`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_6`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_7`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_8`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_9`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_10`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_11`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_12`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_13`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_14`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_15`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_16`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_17`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_18`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_int_19`  int(10) NULL  DEFAULT 0 COMMENT '扩展数字字段',
  `extra_varchar_20`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_0`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_1`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_2`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_3`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_4`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_5`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_6`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_7`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_8`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_9`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_10`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_11`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_12`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_13`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_14`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_15`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_16`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_17`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_18`  varchar(255) NULL  COMMENT '扩展文本字段',
  `extra_varchar_19`  varchar(255) NULL  COMMENT '扩展文本字段',
  `diy_id`  int(10) NULL  DEFAULT 0 COMMENT '详情页面DidId',
  `is_delete`  int(10) NULL  DEFAULT 0 COMMENT '是否删除',
  `lock_num`  int(10) NULL  DEFAULT 0 COMMENT '锁定商品库存',
  `is_new`  varchar(100) NULL  COMMENT '新品类型',
  `can_deposit`  tinyint(2) NULL  DEFAULT 1 COMMENT '是否支持定金支付',
  `reduce_score`  int(10) NULL  DEFAULT 0 COMMENT '可抵扣积分',
  `distribution_price`  float(10) NULL  COMMENT '分销返佣金额',
  `is_spec`  int(10) NULL  DEFAULT 0 COMMENT '是否有规格',
  `file_url`  varchar(255) 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_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`,`addon`) VALUES ('shop_goods','商品列表','0','','1','["title","category_id","imgs","content","cover","type","is_recommend","auto_send","virtual_textarea","is_show","market_price","stock_num","cost_price","sale_price","weight","sn_code","is_delete","is_new","can_deposit"]','1:基础','','','','','cover|get_img_html:封面图\r\ntitle:商品名称\r\nmarket_price:价格\r\nstock_num:库存量\r\nsale_count:销售量\r\nis_show|get_name_by_status:是否上架\r\nids:操作:set_show?id=[id]&is_show=[is_show]|改变上架状态,[EDIT]|编辑,[DELETE]|删除,goodsCommentLists?goods_id=[id]&target=_blank|评论列表','20','title:请输入商品名称','','1422672084','1458898390','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cover','商品封面图','int(10) UNSIGNED NULL','picture','','','1','','0','shop_goods','0','1','1431071756','1422672306','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('content','商品介绍','text NULL','editor','','','1','','0','shop_goods','0','1','1442288877','1422672255','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','商品名称','varchar(255) NOT NULL','string','','','1','','0','shop_goods','1','1','1422672113','1422672113','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('market_price','市场价','decimal(10,2) NULL','num','0','','1','','0','shop_goods','1','1','1442326615','1422672186','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('imgs','商品图片','varchar(255) NULL','mult_picture','','可以上传多个图片,拖曳改变顺序，第一张为商品封面图，建议上传500*500正方形图片','1','','0','shop_goods','1','1','1476362081','1422672449','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('stock_num','库存数量','int(10) NULL','num','0','','1','','0','shop_goods','0','1','1442322062','1422672560','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商店ID','int(10) NULL','num','0','','4','','0','shop_goods','0','1','1422934861','1422931951','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_show','是否上架','tinyint(2) NULL','bool','2','','1','0:下架\r\n1:上架\r\n2:待上架','0','shop_goods','0','1','1467347077','1422935533','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sale_count','销售量','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1422935712','1422935600','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_recommend','是否推荐','tinyint(2) NULL','bool','','推荐后首页的推荐商品里显示','1','0:否\r\n1:是','0','shop_goods','0','1','1423107236','1423107213','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('rank','热销度','int(10) NULL','num','0','热销度由发布时间、推荐状态、销量三个维度进行计算得到','0','','0','shop_goods','0','1','1423474955','1423126715','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('show_time','上架时间','int(10) NULL','datetime','0','','0','','0','shop_goods','0','1','1423127849','1423127833','','3','','regex','time','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cost_price','成本价','decimal(10,2) NULL','num','0','','1','','0','shop_goods','1','1','1442326633','1423132272','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('type','商品类型','tinyint(2) NULL','bool','0','注：虚拟商品不支持货到付款','1','0:实物商品（需要快递）|weight@show\r\n1:虚拟商品（不需要快递）|weight@hide','0','shop_goods','0','1','1442324211','1439458735','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('category_id','商品分类','char(50) NULL','cascade','','','1','type=db&table=shop_goods_category','0','shop_goods','0','1','1442824418','1440066901','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('auto_send','自动发货','char(10) NULL','radio','0','自动发货在用户下单成功时会自动发送虚拟物品的信息','1','0:人工发货|inventory@show,virtual_textarea@hide\r\n1:自动发货|inventory@hide,virtual_textarea@show','0','shop_goods','0','1','1441008893','1440753768','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('virtual_textarea','虚拟物品信息','text NULL','textarea','','每行一条信息 卡密用“|”号分开，如：weiphp@weiphp.cn|123456  ','1','','0','shop_goods','0','1','1441006652','1441006557','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_goods','0','1','1441621773','1441621764','','3','','regex','get_token','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sale_price','促销价','float(10) NULL','num','','','1','','0','shop_goods','1','1','1450776182','1441971805','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('weight','重量','float(10) NULL','num','','单位为g','1','','0','shop_goods','0','1','1452670118','1441971881','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sn_code','商品编号','text NULL','textarea','','','1','','0','shop_goods','0','1','1454058926','1441976829','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_1','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_0','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_2','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_3','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_4','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_5','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_6','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_7','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_8','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_9','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_10','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_11','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_12','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_13','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_14','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_15','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_16','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_17','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_18','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_int_19','扩展数字字段','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442198844','1442198844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_20','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442200574','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_0','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594465','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_1','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594457','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_2','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594448','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_3','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594439','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_4','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594430','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_5','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594509','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_6','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594421','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_7','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594412','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_8','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594403','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_9','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594394','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_10','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594386','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_11','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594369','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_12','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594360','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_13','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594351','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_14','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594343','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_15','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594499','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_16','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594333','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_17','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594323','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_18','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594313','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra_varchar_19','扩展文本字段','varchar(255) NULL','string','','','0','','0','shop_goods','0','1','1442594282','1442200574','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('diy_id','详情页面DidId','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1442800697','1442800218','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_delete','是否删除','int(10) NULL','num','0','','1','','0','shop_goods','0','1','1442830457','1442830457','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('lock_num','锁定商品库存','int(10) NULL','num','0','','0','','0','shop_goods','0','1','1450232028','1450231051','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_new','新品类型','varchar(100) NULL','checkbox','','','1','1:新品\r\n2:热销\r\n3:优惠','0','shop_goods','0','1','1458038429','1458038322','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('can_deposit','是否支持定金支付','tinyint(2) NULL','bool','1','','1','1:支持\r\n0:不支持','0','shop_goods','0','1','1467375261','1458274852','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('reduce_score','可抵扣积分','int(10) NULL','num','0','','1','','0','shop_goods','0','1','1459132496','1459132496','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('distribution_price','分销返佣金额','float(10) NULL','num','','用户收益 = 返佣金额 * 分佣比例  【注：分佣比例 在功能配置里设置】','1','','0','shop_goods','0','1','1467346869','1460099449','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_spec','是否有规格','int(10) NULL','num','0','','0','','0','','0','1','1467376464','1467376464','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('file_url','文件下载链接','varchar(255) NULL','string','','','1','','0','','0','1','1467770480','1467770480','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_goods_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title`  varchar(255) NOT NULL  COMMENT '分类标题',
  `icon`  int(10) unsigned NULL   COMMENT '分类图标',
  `pid`  int(10) unsigned NULL  DEFAULT 0 COMMENT '上一级分类',
  `path`  varchar(255) NULL  COMMENT '分类路径',
  `sort`  int(10) unsigned NULL   DEFAULT 0 COMMENT '排序号',
  `is_show`  tinyint(2) NULL  DEFAULT 1 COMMENT '是否显示',
  `shop_id`  int(10) NOT NULL  DEFAULT 0 COMMENT '商店ID',
  `is_recommend`  tinyint(2) NULL  DEFAULT 0 COMMENT '是否推荐',
  `token`  varchar(100) NULL  COMMENT 'Token',
  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_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`,`addon`) VALUES ('shop_goods_category','商品分类','0','','1','["pid","title","icon","sort","is_recommend","is_show"]','1:基础','','','','','title:30%分组\r\nicon|get_img_html:20%图标\r\nsort:10%排序号\r\nis_show|get_name_by_status:20%显示\r\nids:20%操作:[EDIT]|编辑,[DELETE]|删除','20','title','','1397529095','1467365556','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','分类标题','varchar(255) NOT NULL','string','','','1','','0','shop_goods_category','1','1','1397529407','1397529407','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('icon','分类图标','int(10) unsigned NULL ','picture','','建议上传100X100的正方形图片','1','','0','shop_goods_category','0','1','1431072029','1397529461','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('pid','上一级分类','int(10) unsigned NULL','select','0','如果你要增加一级分类，这里选择“无”即可，最多支持二级分类','1','','0','shop_goods_category','0','1','1467255550','1397529555','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('path','分类路径','varchar(255) NULL','string','','','0','','0','shop_goods_category','0','1','1397529604','1397529604','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sort','排序号','int(10) unsigned NULL ','num','0','数值越小越靠前','1','','0','shop_goods_category','0','1','1397529705','1397529705','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_show','是否显示','tinyint(2) NULL','bool','1','','1','0:不显示\r\n1:显示','0','shop_goods_category','0','1','1397532496','1397529809','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商店ID','int(10) NOT NULL','num','0','','4','','0','shop_goods_category','0','1','1422934193','1422672025','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_recommend','是否推荐','tinyint(2) NULL','bool','0','','1','0:否\r\n1:是','0','shop_goods_category','0','1','1423106432','1423106432','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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(100) NULL','string','','','0','','0','shop_goods_category','0','1','1441528001','1441528001','','3','','regex','get_token','1','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_goods_score` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uid`  int(10) NULL  COMMENT '用户ID',
  `goods_id`  int(10) NULL  COMMENT '商品ID',
  `score`  int(10) NULL  DEFAULT 0 COMMENT '得分',
  `cTime`  int(10) 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_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`,`addon`) VALUES ('shop_goods_score','商品评分记录','0','','1','','1:基础','','','','','','20','','','1422930901','1422930901','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户ID','int(10) NULL','num','','','0','','0','shop_goods_score','0','1','1422931055','1422930936','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品ID','int(10) NULL','num','','','0','','0','shop_goods_score','0','1','1422930970','1422930970','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('score','得分','int(10) NULL','num','0','','0','','0','shop_goods_score','0','1','1422931004','1422931004','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','0','','0','shop_goods_score','0','1','1422931044','1422931044','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_datas`  text NOT NULL  COMMENT '商品序列化数据',
  `uid`  int(10) UNSIGNED NOT NULL  COMMENT '用户id',
  `remark`  text NOT NULL  COMMENT '备注',
  `order_number`  varchar(255) NOT NULL  COMMENT '订单编号',
  `cTime`  int(10) NOT NULL  COMMENT '订单时间',
  `total_price`  decimal(10,2) NULL  COMMENT '总价',
  `openid`  varchar(255) NOT NULL  COMMENT 'OpenID',
  `pay_status`  int(10)  NULL  COMMENT '支付状态',
  `pay_type`  int(10) NULL  COMMENT '支付类型',
  `address_id`  int(10) NULL  COMMENT '配送信息',
  `is_send`  int(10) NULL  DEFAULT 0 COMMENT '是否发货',
  `send_code`  varchar(255) NULL  COMMENT '快递公司编号',
  `send_number`  varchar(255) NULL  COMMENT '快递单号',
  `send_type`  char(10) NULL  COMMENT '发货类型',
  `is_new`  tinyint(2) NULL  DEFAULT 1 COMMENT '是否为新订单',
  `shop_id`  int(10) NULL  DEFAULT 0 COMMENT '商店编号',
  `status_code`  char(50) NULL  DEFAULT 0 COMMENT '订单跟踪状态码',
  `order_from_type`  int(10) NULL  DEFAULT 0 COMMENT '订单来源',
  `token`  varchar(255) NULL  COMMENT 'token',
  `manager_id`  int(10) NULL  COMMENT '管理员id',
  `is_lock`  int(10) NULL  DEFAULT 1 COMMENT '数量是否锁定',
  `erp_lock_code`  text NULL  COMMENT 'ERP锁定商品编号',
  `is_deposit`  int(10) NULL  DEFAULT 0 COMMENT '是否定金支付',
  `deposit_money`  float(10) NULL  COMMENT '定金金额',
  `mail_money`  float(10) NULL  DEFAULT 0 COMMENT '邮费金额',
  `coupon_shop_id`  int(10) NULL  COMMENT '门店编号',
  `is_mail`  int(10) NULL  COMMENT '是否邮寄',
  `pay_time`  int(10) NULL  COMMENT '支付时间',
  `send_time`  int(10) 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_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`,`addon`) VALUES ('shop_order','订单记录','0','','1','["uid","goods_datas","remark","order_number","cTime","total_price","address_id","is_send","send_code","send_number","send_type","shop_id"]','1:基础','','','','','order_number:15%订单编号\r\ngoods:20%下单商品\r\nuid:10%客户\r\ntotal_price:7%总价\r\ncTime|time_format:17%下单时间\r\ncommon|get_name_by_status:10%支付类型\r\nstatus_code|get_name_by_status:10%订单跟踪\r\naction:11%操作','20','order_number:请输入订单编号 或 客户昵称','','1420269240','1440147136','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_datas','商品序列化数据','text NOT NULL','textarea','','','1','','0','shop_order','0','1','1423534050','1420269321','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户id','int(10) UNSIGNED NOT NULL','num','','','1','','0','shop_order','0','1','1420269348','1420269348','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('remark','备注','text NOT NULL','textarea','','','1','','0','shop_order','0','1','1423534071','1420269399','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('order_number','订单编号','varchar(255) NOT NULL','string','','','1','','0','shop_order','0','1','1423534179','1420269451','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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','shop_order','0','1','1423534102','1420269666','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('total_price','总价','decimal(10,2) NULL','num','','','1','','0','shop_order','0','1','1439812371','1420272711','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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','','','0','','0','shop_order','0','1','1420526437','1420526437','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('pay_status','支付状态','int(10)  NULL','num','','','0','0:未支付\r\n1:已支付\r\n2:支付订金','0','shop_order','0','1','1458785671','1420596969','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('pay_type','支付类型','int(10) NULL','num','','','0','','0','shop_order','0','1','1423537868','1420596998','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('address_id','配送信息','int(10) NULL','num','','','1','','0','shop_order','0','1','1423534264','1423534264','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_send','是否发货','int(10) NULL','num','0','','1','','0','shop_order','0','1','1438336095','1438336095','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('send_code','快递公司编号','varchar(255) NULL','string','','','1','','0','shop_order','0','1','1438336511','1438336511','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('send_number','快递单号','varchar(255) NULL','string','','','1','','0','shop_order','0','1','1438336556','1438336556','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('send_type','发货类型','char(10) NULL','radio','','','1','0|线上发货\r\n1|物流公司发货','0','shop_order','0','1','1438336756','1438336756','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_new','是否为新订单','tinyint(2) NULL','bool','1','','0','0:否\r\n1:是','0','shop_order','0','1','1439435979','1439435969','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商店编号','int(10) NULL','num','0','','1','','0','shop_order','0','1','1439455026','1439455026','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('status_code','订单跟踪状态码','char(50) NULL','select','0','','0','0:待支付\r\n1:待商家确认\r\n2:待发货\r\n3:配送中\r\n4:确认已收货\r\n5:确认已收款\r\n6:待评价\r\n7:已评价','0','shop_order','0','1','1439536746','1439526095','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('order_from_type','订单来源','int(10) NULL','num','0','','0','0:商城\r\n1:电视购物','0','shop_order','0','1','1441100373','1441100373','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_order','0','1','1441713216','1441713216','','3','','regex','get_token','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('manager_id','管理员id','int(10) NULL','num','','','1','','0','shop_order','0','1','1441713730','1441713730','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_lock','数量是否锁定','int(10) NULL','num','1','','1','1:锁定\r\n0:释放','0','shop_order','0','1','1450271457','1450271457','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('erp_lock_code','ERP锁定商品编号','text NULL','textarea','','','1','','0','shop_order','0','1','1454067976','1454067976','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_deposit','是否定金支付','int(10) NULL','num','0','','1','0:全额\r\n1:定金','0','shop_order','0','1','1458703558','1458703558','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('deposit_money','定金金额','float(10) NULL','num','','','1','','0','shop_order','0','1','1458703613','1458703613','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('mail_money','邮费金额','float(10) NULL','num','0','0包邮','1','','0','shop_order','0','1','1458706012','1458703658','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('coupon_shop_id','门店编号','int(10) NULL','num','','','1','','0','shop_order','0','1','1458704600','1458704600','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_mail','是否邮寄','int(10) NULL','num','','','1','1:邮寄\r\n0:门店','0','shop_order','0','1','1458704798','1458704798','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('pay_time','支付时间','int(10) NULL','datetime','','','1','','0','shop_order','0','1','1458808110','1458808110','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('send_time','发货时间','int(10) NULL','datetime','','','1','','0','shop_order','0','1','1458809227','1458809227','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_order_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `order_id`  int(10) NULL  COMMENT '订单ID',
  `status_code`  char(50) NULL  DEFAULT 0 COMMENT '状态码',
  `remark`  varchar(255) NULL  COMMENT '备注内容',
  `cTime`  int(10) NULL  COMMENT '时间',
  `extend`  varchar(255) 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_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`,`addon`) VALUES ('shop_order_log','订单跟踪','0','','1','','1:基础','','','','','','10','','','1439525562','1439525562','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('order_id','订单ID','int(10) NULL','num','','','0','','0','shop_order_log','0','1','1439525588','1439525588','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('status_code','状态码','char(50) NULL','select','0','','0','0:待支付\r\n1:待商家确认\r\n2:待发货\r\n3:配送中\r\n4:确认已收货\r\n5:确认已收款\r\n6:待评价\r\n7:已评价','0','shop_order_log','0','1','1439536678','1439525934','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('remark','备注内容','varchar(255) NULL','string','','','0','','0','shop_order_log','0','1','1439525979','1439525979','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','0','','0','shop_order_log','0','1','1439526002','1439526002','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extend','扩展信息','varchar(255) NULL','string','','','0','','0','shop_order_log','0','1','1439526038','1439526038','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_slideshow` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title`  varchar(255) NULL  COMMENT '标题',
  `img`  int(10) unsigned NOT NULL   COMMENT '图片',
  `url`  varchar(255) NULL  COMMENT '链接地址',
  `is_show`  tinyint(2) NULL  DEFAULT 1 COMMENT '是否显示',
  `sort`  int(10) unsigned NULL   DEFAULT 0 COMMENT '排序',
  `token`  varchar(100) NULL  COMMENT 'Token',
  `shop_id`  int(10) NULL  DEFAULT 0 COMMENT '商店ID',
  `uid`  int(10) NULL  COMMENT '用户id',
  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_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`,`addon`) VALUES ('shop_slideshow','幻灯片','0','','1','["title","img","url","is_show","sort"]','1:基础','','','','','title:标题\r\nimg:图片\r\nurl:链接地址\r\nis_show|get_name_by_status:显示\r\nsort:排序\r\nids:操作:[EDIT]&module_id=[pid]|编辑,[DELETE]|删除','20','title','','1396098264','1408323347','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','标题','varchar(255) NULL','string','','可为空','1','','0','shop_slideshow','0','1','1396098316','1396098316','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('img','图片','int(10) unsigned NOT NULL ','picture','','最佳尺寸为320*160','1','','0','shop_slideshow','1','1','1476367422','1396098349','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('url','链接地址','varchar(255) NULL','string','','','1','','0','shop_slideshow','0','1','1396098380','1396098380','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_show','是否显示','tinyint(2) NULL','bool','1','','1','0:不显示\r\n1:显示','0','shop_slideshow','0','1','1396098464','1396098464','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sort','排序','int(10) unsigned NULL ','num','0','值越小越靠前','1','','0','shop_slideshow','0','1','1396098682','1396098682','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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(100) NULL','string','','','0','','0','shop_slideshow','0','1','1396098747','1396098747','','3','','regex','get_token','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商店ID','int(10) NULL','num','0','','4','','0','shop_slideshow','0','1','1422934490','1422932093','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户id','int(10) NULL','num','','','0','','0','shop_slideshow','0','1','1441626202','1441626194','','3','','regex','get_mid','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_virtual` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id`  int(10) NULL  COMMENT '商品ID',
  `account`  varchar(255) NULL  COMMENT '账号',
  `password`  varchar(255) NULL  COMMENT '密码',
  `is_use`  char(10) NULL  DEFAULT 0 COMMENT '是否已经使用',
  `order_id`  int(10) NULL  COMMENT '订单号',
  `card_codes`  varchar(255) NULL  COMMENT '点卡序列号',
  `token`  varchar(255) NULL  COMMENT 'token',
  `uid`  int(10) NULL  COMMENT '购买用户uid',
  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_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`,`addon`) VALUES ('shop_virtual','虚拟物品信息','0','','1','','1:基础','','','','','','10','','','1441006502','1441006502','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品ID','int(10) NULL','num','','','0','','0','shop_virtual','0','1','1441006705','1441006705','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('account','账号','varchar(255) NULL','string','','','1','','0','shop_virtual','0','1','1441006766','1441006766','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('password','密码','varchar(255) NULL','string','','','1','','0','shop_virtual','0','1','1441006785','1441006785','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_use','是否已经使用','char(10) NULL','radio','0','','1','0:未使用\r\n1:已使用','0','shop_virtual','0','1','1441006967','1441006967','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('order_id','订单号','int(10) NULL','num','','','0','','0','shop_virtual','0','1','1441015297','1441015297','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('card_codes','点卡序列号','varchar(255) NULL','string','','','1','','0','','0','1','1467770545','1467770545','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','','0','1','1467770569','1467770569','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','购买用户uid','int(10) NULL','num','','','1','','0','','0','1','1467770587','1467770587','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_goods_downshelf_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id`  int(10) NULL  COMMENT '商品id',
  `down_shelf`  int(10) NULL  DEFAULT 0 COMMENT '是否下架',
  `uid`  int(10) NULL  COMMENT '普通用户uid',
  `token`  varchar(255) NULL  COMMENT 'token',
  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_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`,`addon`) VALUES ('shop_goods_downshelf_user','普通用户下架商品','0','','1','["goods_id","is_down_shelf"]','1:基础','','','','','','10','','','1441700655','1441700989','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品id','int(10) NULL','num','','','1','','0','shop_goods_downshelf_user','0','1','1441700844','1441700844','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('down_shelf','是否下架','int(10) NULL','num','0','','1','0:下架\r\n1:上架\r\n','0','shop_goods_downshelf_user','0','1','1441704190','1441700976','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','普通用户uid','int(10) NULL','num','','','1','','0','shop_goods_downshelf_user','0','1','1441701024','1441701024','','3','','regex','get_mid','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_goods_downshelf_user','0','1','1441701045','1441701045','','3','','regex','get_token','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_membership` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `membership`  varchar(255) NULL  COMMENT '会员名',
  `condition`  int(10) NULL  DEFAULT 0 COMMENT '升级会员条件',
  `uid`  int(10) NULL  COMMENT '企业用户id',
  `token`  varchar(255) NULL  COMMENT 'token',
  `img`  int(10) UNSIGNED 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_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`,`addon`) VALUES ('shop_membership','商城会员设置','0','','1','["membership","img","condition"]','1:基础','','','','','img|get_img_html:20%会员图标\r\nmembership:25%会员名\r\ncondition:20%条件（经历值）\r\nid:30%操作:[EDIT]|编辑,[DELETE]|删除','10','membership:请输入会员名','','1441787383','1441857253','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('membership','会员名','varchar(255) NULL','string','','','1','','0','shop_membership','1','1','1441791109','1441788365','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('condition','升级会员条件','int(10) NULL','num','0','以用户经历值做为升级条件','1','','0','shop_membership','0','1','1441857240','1441789777','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','企业用户id','int(10) NULL','num','','','0','','0','shop_membership','0','1','1441790752','1441790752','','3','','regex','get_mid','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_membership','0','1','1441790783','1441790783','','3','','regex','get_token','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('img','图标','int(10) UNSIGNED NULL','picture','','','1','','0','shop_membership','1','1','1441856273','1441855675','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_spec` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title`  varchar(30) NULL  COMMENT '规格名称',
  `remark`  varchar(100) NULL  COMMENT '备注',
  `sort`  int(10) NULL  DEFAULT 0 COMMENT '排序',
  `uid`  int(10) NULL  COMMENT '用户ID',
  `token`  varchar(255) NULL  COMMENT 'token',
  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_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`,`addon`) VALUES ('shop_spec','商品规格','0','','1','["title","remark","sort"]','1:基础','','','','','title:规格名称\r\nremark:规格属性\r\nid:操作:[EDIT]|编辑,[DELETE]|删除','10','title:请输入规格名称','','1441942151','1441943264','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','规格名称','varchar(30) NULL','string','','','1','','0','shop_spec','1','1','1441942269','1441942269','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('remark','备注','varchar(100) NULL','string','','','1','','0','shop_spec','0','1','1441942306','1441942306','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sort','排序','int(10) NULL','num','0','排序号越大排列越靠前','1','','0','shop_spec','0','1','1441942462','1441942351','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户ID','int(10) NULL','num','','','0','','0','shop_spec','0','1','1441942416','1441942416','','3','','regex','get_mid','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','','0','1','1476346057','1476346057','','3','','regex','get_token','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_spec_option` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `spec_id`  int(10) NULL  COMMENT '规格ID',
  `name`  varchar(100) NULL  COMMENT '规格属性名称',
  `sort`  int(10) NULL  DEFAULT 0 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_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`,`addon`) VALUES ('shop_spec_option','商品规格选项','0','','1','','1:基础','','','','','','10','','','1441942503','1441942503','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('spec_id','规格ID','int(10) NULL','num','','','0','','0','shop_spec_option','0','1','1441942548','1441942548','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('name','规格属性名称','varchar(100) NULL','string','','','1','','0','shop_spec_option','1','1','1441942605','1441942605','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sort','排序号','int(10) NULL','num','0','排序号越大排列越靠前','1','','0','shop_spec_option','0','1','1441942637','1441942637','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_distribution_profit` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `token`  varchar(255) NULL  COMMENT 'token',
  `uid`  int(10) NULL  COMMENT 'Uid',
  `ctime`  int(10) NULL  COMMENT '返利时间',
  `profit`  float(10)  NULL  DEFAULT 0 COMMENT '拥金',
  `profit_shop`  int(10) NULL  COMMENT '获得佣金的店铺',
  `distribution_percent`  varchar(255) NULL  COMMENT '分销比例',
  `order_id`  int(10) NULL  COMMENT '订单id',
  `upper_user`  int(10) NULL  COMMENT '分销用户',
  `upper_level`  int(10) NULL  COMMENT '分销用户级别',
  `duser`  int(10) 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_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`,`addon`) VALUES ('shop_distribution_profit','分销用户返利表','0','','1','','1:基础','','','','','','10','','','1441957173','1441957173','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_distribution_profit','0','1','1441957233','1441957233','','3','','regex','get_token','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','Uid','int(10) NULL','num','','','0','','0','shop_distribution_profit','0','1','1441960826','1441957266','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','1','','0','shop_distribution_profit','0','1','1441957292','1441957292','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('profit','拥金','float(10)  NULL','num','0','','1','','0','shop_distribution_profit','0','1','1442204022','1441957415','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('profit_shop','获得佣金的店铺','int(10) NULL','num','','','0','','0','shop_distribution_profit','0','1','1460443475','1441957488','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('distribution_percent','分销比例','varchar(255) NULL','string','','','1','','0','shop_distribution_profit','0','1','1441957786','1441957786','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('order_id','订单id','int(10) NULL','num','','','1','','0','shop_distribution_profit','0','1','1441959316','1441959316','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('upper_user','分销用户','int(10) NULL','num','','','1','','0','shop_distribution_profit','0','1','1460443334','1460443334','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('upper_level','分销用户级别','int(10) NULL','num','','','1','','0','shop_distribution_profit','0','1','1460443383','1460443383','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('duser','该用户带来的消费用户','int(10) NULL','num','','','0','','0','shop_distribution_profit','0','1','1460537404','1460537404','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_attribute` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_show`  tinyint(2) NULL  DEFAULT 1 COMMENT '是否显示',
  `cate_id`  int(10) UNSIGNED NULL  COMMENT '所属分类ID',
  `error_info`  varchar(255) NULL  COMMENT '出错提示',
  `sort`  int(10) UNSIGNED NULL  DEFAULT 0 COMMENT '排序号',
  `validate_rule`  varchar(255) NULL  COMMENT '正则验证',
  `is_must`  tinyint(2) NULL  COMMENT '是否必填',
  `remark`  varchar(255) NULL  COMMENT '字段备注',
  `token`  varchar(255) NULL  COMMENT 'Token',
  `value`  varchar(255) NULL  COMMENT '默认值',
  `title`  varchar(255) NOT NULL  COMMENT '字段标题',
  `mTime`  int(10) NULL  COMMENT '修改时间',
  `extra`  text NULL  COMMENT '参数',
  `attr_type`  char(50) NOT NULL  DEFAULT 'string' COMMENT '字段类型',
  `type`  tinyint(2) NULL  DEFAULT 0 COMMENT '属性类型',
  `name`  varchar(30) NULL  COMMENT '属性标识',
  `goods_field`  varchar(50) 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_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`,`addon`) VALUES ('shop_attribute','分类属性','0','','1','["title","attr_type","extra","value","sort"]','1:基础','','','','','title:字段标题\r\ntype|get_name_by_status:字段类型\r\nextra:参数\r\nsort:排序\r\nids:操作:[EDIT]&cate_id=[cate_id]|编辑,[DELETE]|删除','20','title','','1396061373','1442368516','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_show','是否显示','tinyint(2) NULL','select','1','是否显示在表单中','0','1:显示\r\n0:不显示','0','shop_attribute','0','1','1396848437','1396848437','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cate_id','所属分类ID','int(10) UNSIGNED NULL','num','','','4','','0','shop_attribute','0','1','1396710040','1396690613','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('error_info','出错提示','varchar(255) NULL','string','','验证不通过时的提示语','0','','0','shop_attribute','0','1','1396685920','1396685920','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sort','排序号','int(10) UNSIGNED NULL','num','0','值越小越靠前','1','','0','shop_attribute','0','1','1396685825','1396685825','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('validate_rule','正则验证','varchar(255) NULL','string','','为空表示不作验证','0','','0','shop_attribute','0','1','1396685776','1396685776','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_must','是否必填','tinyint(2) NULL','bool','','用于自动验证','0','0:否\r\n1:是','0','shop_attribute','0','1','1396685579','1396685579','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('remark','字段备注','varchar(255) NULL','string','','用于表单中的提示','0','','0','shop_attribute','0','1','1396685482','1396685482','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_attribute','0','1','1396602871','1396602859','','3','','regex','get_token','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('value','默认值','varchar(255) NULL','string','','字段的默认值','1','','0','shop_attribute','0','1','1396685291','1396685291','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','字段标题','varchar(255) NOT NULL','string','','请输入字段标题，用于表单显示','1','','0','shop_attribute','1','1','1396676830','1396676830','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('mTime','修改时间','int(10) NULL','datetime','','','0','','0','shop_attribute','0','1','1396624664','1396624664','','3','','regex','time','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('extra','参数','text NULL','textarea','','每行一个参数','1','','0','shop_attribute','0','1','1441963175','1396685105','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('attr_type','字段类型','char(50) NOT NULL','select','string','用于表单中的展示方式','1','string:单行输入|extra@hide\r\ntextarea:多行输入|extra@hide\r\nradio:单选|extra@show\r\ncheckbox:多选|extra@show\r\nselect:下拉选择|extra@show\r\ndatetime:时间选择|extra@hide\r\npicture:上传图片|extra@hide','0','shop_attribute','1','1','1441963886','1396683600','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('type','属性类型','tinyint(2) NULL','bool','0','','4','0:筛选属性\r\n1:普通属性','0','shop_attribute','0','1','1441963898','1441962940','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('name','属性标识','varchar(30) NULL','string','','','0','','0','shop_attribute','0','1','1441963238','1441963238','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_field','商品表中所占用的字段名','varchar(50) NULL','string','','','0','','0','shop_attribute','0','1','1442198629','1442198629','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_value` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `cate_id`  int(10) UNSIGNED NULL  COMMENT '所属分类ID',
  `value`  text NULL  COMMENT '表单值',
  `cTime`  int(10) NULL  COMMENT '增加时间',
  `openid`  varchar(255) NULL  COMMENT 'OpenId',
  `uid`  int(10) NULL  COMMENT '用户ID',
  `token`  varchar(255) NULL  COMMENT 'Token',
  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_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`,`addon`) VALUES ('shop_value','分类扩展属性数据表','0','','1','','1:基础','','','','','','20','','','1396687959','1396687959','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cate_id','所属分类ID','int(10) UNSIGNED NULL','num','','','4','','0','shop_value','0','1','1396710064','1396688308','','3','','regex','','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('value','表单值','text NULL','textarea','','','0','','0','shop_value','0','1','1396688355','1396688355','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','0','','0','shop_value','0','1','1396688434','1396688434','','3','','regex','time','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_value','0','1','1396688187','1396688187','','3','','regex','get_openid','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户ID','int(10) NULL','num','','','0','','0','shop_value','0','1','1396688042','1396688042','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_value','0','1','1396690911','1396690911','','3','','regex','get_token','1','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_page` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title`  varchar(255) NULL  COMMENT '页面名称',
  `ctime`  int(15) NULL  COMMENT '创建时间',
  `config`  text NULL  COMMENT '配置参数',
  `desc`  text NULL  COMMENT '描述',
  `shop_id`  int(10) NULL  COMMENT '店铺ID',
  `token`  varchar(255) NULL  COMMENT 'token',
  `manager_id`  int(10) NULL  COMMENT '创建者ID',
  `use`  varchar(255) NULL  DEFAULT 'page' COMMENT '哪里使用',
  `is_show`  tinyint(2) NULL  DEFAULT 0 COMMENT '是否显示底部导航',
  `is_index`  int(10) NULL  DEFAULT 0 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_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`,`addon`) VALUES ('shop_page','自定义页面','0','','1','["title","ctime","config","desc","shop_id","token","manager_id","use"]','1:基础','','','','','title:页面标题\r\nctime|time_format:创建时间\r\nids:操作:preview?id=[id]&target=_blank|预览,[EDIT]|编辑,[DELETE]|删除\r\ncopy:复制链接','10','','','1442202619','1442821956','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','页面名称','varchar(255) NULL','string','','','1','','0','shop_page','0','1','1442202642','1442202642','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('ctime','创建时间','int(15) NULL','datetime','','','1','','0','shop_page','0','1','1442375202','1442202720','','3','','regex','time','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('config','配置参数','text NULL','textarea','','','1','','0','shop_page','0','1','1442324638','1442324638','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('desc','描述','text NULL','textarea','','','1','','0','shop_page','0','1','1442324949','1442324949','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','店铺ID','int(10) NULL','num','','','1','','0','shop_page','0','1','1442547531','1442547531','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_page','0','1','1442548340','1442547553','','3','','regex','get_token','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('manager_id','创建者ID','int(10) NULL','num','','','1','','0','shop_page','0','1','1442548325','1442547593','','3','','regex','get_mid','1','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('use','哪里使用','varchar(255) NULL','string','page','','1','','0','shop_page','0','1','1442547935','1442547935','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_show','是否显示底部导航','tinyint(2) NULL','radio','0','','1','0:不显示\r\n1:显示','0','shop_page','0','1','1452322203','1452321696','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_index','设为首页','int(10) NULL','num','0','','1','0:否\r\n1:是','0','shop_page','0','1','1453454255','1453454255','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_goods_sku_data` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id`  int(10) NULL  COMMENT '商品ID',
  `cost_price`  decimal(11,2) NULL  DEFAULT 0 COMMENT '成本价',
  `market_price`  decimal(11,2) NULL  DEFAULT 0 COMMENT '市场价',
  `sale_price`  decimal(11,2) NULL  DEFAULT 0 COMMENT '促销价',
  `stock_num`  int(10) NULL  DEFAULT 0 COMMENT '库存量',
  `sn_code`  varchar(50) NULL  COMMENT '商品编号',
  `sku_int_0`  int(10) NULL  DEFAULT 0 COMMENT '数量规格0',
  `sku_int_1`  int(10) NULL  DEFAULT 0 COMMENT '数量规格1',
  `sku_int_2`  int(10) NULL  DEFAULT 0 COMMENT '数量规格2',
  `sku_varchar_0`  varchar(255) NULL  COMMENT '文本规格0',
  `sku_varchar_1`  varchar(255) NULL  COMMENT '文本规格1',
  `sku_varchar_2`  varchar(255) NULL  COMMENT '文本规格2',
  `spec_option_ids`  varchar(100) NULL  COMMENT '规格属性ID串',
  `lock_num`  int(10) NULL  DEFAULT 0 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_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`,`addon`) VALUES ('shop_goods_sku_data','商品规格表','0','','1','["cost_price"]','1:基础','','','','','','10','','','1442221199','1442309479','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品ID','int(10) NULL','num','','','0','','0','shop_goods_sku_data','0','1','1442221248','1442221248','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cost_price','成本价','decimal(11,2) NULL','num','0','','1','','0','shop_goods_sku_data','0','1','1442221902','1442221902','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('market_price','市场价','decimal(11,2) NULL','num','0','','0','','0','shop_goods_sku_data','0','1','1442221974','1442221974','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sale_price','促销价','decimal(11,2) NULL','num','0','','0','','0','shop_goods_sku_data','0','1','1442283911','1442222057','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('stock_num','库存量','int(10) NULL','num','0','','0','','0','shop_goods_sku_data','0','1','1442223404','1442223404','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sn_code','商品编号','varchar(50) NULL','string','','','0','','0','shop_goods_sku_data','0','1','1442223451','1442223451','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sku_int_0','数量规格0','int(10) NULL','num','0','','0','','0','shop_goods_sku_data','0','1','1442223698','1442223592','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sku_int_1','数量规格1','int(10) NULL','num','0','','0','','0','shop_goods_sku_data','0','1','1442223711','1442223638','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sku_int_2','数量规格2','int(10) NULL','num','0','','0','','0','shop_goods_sku_data','0','1','1442223754','1442223754','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sku_varchar_0','文本规格0','varchar(255) NULL','string','','','0','','0','shop_goods_sku_data','0','1','1442223793','1442223793','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sku_varchar_1','文本规格1','varchar(255) NULL','string','','','0','','0','shop_goods_sku_data','0','1','1442223823','1442223823','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sku_varchar_2','文本规格2','varchar(255) NULL','string','','','0','','0','shop_goods_sku_data','0','1','1442223852','1442223852','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('spec_option_ids','规格属性ID串','varchar(100) NULL','string','','','0','','0','shop_goods_sku_data','0','1','1442309448','1442223947','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('lock_num','商品锁定库存','int(10) NULL','num','0','','1','','0','shop_goods_sku_data','0','1','1450232179','1450232179','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_goods_sku_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id`  int(10) NULL  DEFAULT 0 COMMENT '商品ID',
  `spec_id`  int(10) NULL  DEFAULT 0 COMMENT '规格ID',
  `option_id`  int(10) NULL  DEFAULT 0 COMMENT '属性ID',
  `img`  int(10) UNSIGNED 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_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`,`addon`) VALUES ('shop_goods_sku_config','商品规格配置','0','','1','','1:基础','','','','','','10','','','1442309511','1442309511','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品ID','int(10) NULL','num','0','','0','','0','shop_goods_sku_config','0','1','1442309548','1442309548','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('spec_id','规格ID','int(10) NULL','num','0','','0','','0','shop_goods_sku_config','0','1','1442309580','1442309580','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('option_id','属性ID','int(10) NULL','num','0','','0','','0','shop_goods_sku_config','0','1','1442309607','1442309607','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('img','属性加图','int(10) UNSIGNED NULL','picture','','','0','','0','shop_goods_sku_config','0','1','1442309652','1442309652','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_cashout_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `cashout_amount`  float(10) NULL  COMMENT '提现金额',
  `remark`  text NULL  COMMENT '备注',
  `cashout_account`  varchar(300) NULL  COMMENT '提现账号',
  `cashout_status`  int(10) NULL  DEFAULT 0 COMMENT '提现处理状态',
  `ctime`  int(10) NULL  COMMENT '提现时间',
  `uid`  int(10) NULL  COMMENT 'uid',
  `token`  varchar(255) NULL  COMMENT 'token',
  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_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`,`addon`) VALUES ('shop_cashout_log','提现记录表','0','','1','["cashout_amount","remark","cashout_status","ctime","token","cashout_account"]','1:基础','','','','','ctime|time_format:申请日期\r\ncashout_amount:申请金额（￥）\r\ntype:提现方式\r\ncashout_account:提现账号\r\nname:账号名称\r\ncashout_status|get_name_by_status:审核状态\r\nremark:详细','10','','','1442315168','1442478119','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cashout_amount','提现金额','float(10) NULL','num','','','1','','0','shop_cashout_log','0','1','1442315267','1442315267','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('remark','备注','text NULL','textarea','','','1','','0','shop_cashout_log','0','1','1442315310','1442315310','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cashout_account','提现账号','varchar(300) NULL','string','','','1','','0','shop_cashout_log','0','1','1442462950','1442315434','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('cashout_status','提现处理状态','int(10) NULL','num','0','','1','0:处理中\r\n1:提现成功\r\n2:提现失败','0','shop_cashout_log','0','1','1442315554','1442315554','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','1','','0','shop_cashout_log','0','1','1442315608','1442315608','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','uid','int(10) NULL','num','','','0','','0','shop_cashout_log','0','1','1442315672','1442315631','','3','','regex','get_mid','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_cashout_log','0','1','1442315658','1442315658','','3','','regex','get_mid','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_cashout_account` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `account`  varchar(255) NULL  COMMENT '提现账号',
  `type`  char(50) NULL  COMMENT '提现方式',
  `name`  varchar(255) NULL  COMMENT '姓名',
  `uid`  int(10) NULL  COMMENT 'uid',
  `token`  varchar(255) NULL  COMMENT 'token',
  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_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`,`addon`) VALUES ('shop_cashout_account','提现账号','0','','1','','1:基础','','','','','','10','','','1442396922','1442396922','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('account','提现账号','varchar(255) NULL','string','','','1','','0','shop_cashout_account','0','1','1442396978','1442396978','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('type','提现方式','char(50) NULL','radio','','','1','0:支付宝\r\n1:银行','0','shop_cashout_account','0','1','1442397717','1442397066','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('name','姓名','varchar(255) NULL','string','','','1','','0','shop_cashout_account','0','1','1442397096','1442397096','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','uid','int(10) NULL','num','','','1','','0','shop_cashout_account','0','1','1442397118','1442397118','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_cashout_account','0','1','1442397139','1442397139','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_distribution_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uid`  int(10) NULL  COMMENT '用户id',
  `enable`  char(10) NULL  DEFAULT 1 COMMENT '是否启用',
  `branch_id`  varchar(255) NULL  COMMENT '授权门店',
  `ctime`  int(10) NULL  COMMENT '创建时间',
  `token`  varchar(255) NULL  COMMENT 'token',
  `qr_code`  varchar(255) NULL  COMMENT '二维码',
  `fans_gift_money`  int(10) NULL  DEFAULT 0 COMMENT '转发增粉奖励金额',
  `fans_gift_score`  int(10) NULL  DEFAULT 0 COMMENT '转发增粉奖励积分',
  `fans_gift_shop_coupon`  int(10) NULL  DEFAULT 0 COMMENT '转发增粉奖励代金券',
  `fans_gift_coupon`  int(10) NULL  DEFAULT 0 COMMENT '转发增粉奖励优惠券',
  `wechat`  varchar(255) NULL  COMMENT '微信号',
  `inviter`  varchar(255) NULL  COMMENT '邀请人',
  `level`  int(10) NULL  COMMENT '分佣级别',
  `is_audit`  int(10) NULL  DEFAULT 0 COMMENT '是否审核',
  `is_delete`  int(10) NULL  DEFAULT 0 COMMENT '是否删除',
  `shop_name`  varchar(255) NULL  COMMENT '商城店名字',
  `shop_logo`  varchar(300) NULL  COMMENT '商城图标',
  `profit_money`  float(10) NULL  DEFAULT 0 COMMENT '盈利金额',
  `zfb_name`  varchar(255) NULL  COMMENT '支付宝名称',
  `zfb_account`  varchar(255) 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_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`,`addon`) VALUES ('shop_distribution_user','分销用户','0','','1','["uid","qr_code","wechat","inviter","level","is_audit"]','1:基础','','','','','id:序号\r\ntruename:姓名\r\nmobile:手机号\r\nuid:微信昵称\r\nwechat:微信号\r\ninviter:邀请人\r\nctime|time_format:创建时间\r\nlevel:分销级别\r\nis_audit:审核\r\nids:操作:[EDIT]|编辑','10','truename:请输入姓名','','1442922612','1460357351','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户id','int(10) NULL','num','','','1','','0','shop_distribution_user','0','1','1442922644','1442922644','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('enable','是否启用','char(10) NULL','radio','1','','0','0:否\r\n1:是','0','shop_distribution_user','0','1','1459828072','1442922940','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('branch_id','授权门店','varchar(255) NULL','cascade','','','0','type=db&table=coupon_shop&branch_id=id','0','shop_distribution_user','0','1','1443186424','1442923081','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','0','','0','shop_distribution_user','0','1','1443002634','1442923109','','3','','regex','time','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_distribution_user','0','1','1442924496','1442923193','','3','','regex','get_token','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('qr_code','二维码','varchar(255) NULL','string','','','1','','0','shop_distribution_user','0','1','1442975336','1442975336','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('fans_gift_money','转发增粉奖励金额','int(10) NULL','num','0','','0','','0','shop_distribution_user','0','1','1445492396','1445491625','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('fans_gift_score','转发增粉奖励积分','int(10) NULL','num','0','','0','','0','shop_distribution_user','0','1','1445492390','1445491653','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('fans_gift_shop_coupon','转发增粉奖励代金券','int(10) NULL','num','0','','0','','0','shop_distribution_user','0','1','1445492384','1445491691','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('fans_gift_coupon','转发增粉奖励优惠券','int(10) NULL','num','0','','0','','0','shop_distribution_user','0','1','1445492377','1445491720','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('wechat','微信号','varchar(255) NULL','string','','','1','','0','shop_distribution_user','0','1','1459824262','1459824262','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('inviter','邀请人','varchar(255) NULL','string','','','1','','0','shop_distribution_user','0','1','1459824287','1459824287','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('level','分佣级别','int(10) NULL','num','','','1','','0','shop_distribution_user','0','1','1459824313','1459824313','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_audit','是否审核','int(10) NULL','num','0','','1','0:未审核\r\n1:通过\r\n2:未通过','0','shop_distribution_user','0','1','1459845593','1459824348','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_delete','是否删除','int(10) NULL','num','0','','0','','0','shop_distribution_user','0','1','1459910858','1459910858','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_name','商城店名字','varchar(255) NULL','string','','默认为 用户姓名 的小店','0','','0','shop_distribution_user','0','1','1460108215','1460108215','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_logo','商城图标','varchar(300) NULL','string','','默认为 用户的头像','0','','0','shop_distribution_user','0','1','1460342702','1460108257','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('profit_money','盈利金额','float(10) NULL','num','0','','1','','0','shop_distribution_user','0','1','1460520083','1460443598','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('zfb_name','支付宝名称','varchar(255) NULL','string','','','0','','0','','0','1','1467200108','1467200108','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('zfb_account','支付宝账号','varchar(255) NULL','string','','','0','','0','','0','1','1467200236','1467200236','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_statistics_follow` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uid`  int(10) NULL  COMMENT '粉丝id',
  `duid`  int(10) NULL  COMMENT '分销用户id',
  `ctime`  int(10) NULL  COMMENT '关注时间',
  `token`  varchar(255) NULL  COMMENT 'token',
  `openid`  varchar(255) NULL  COMMENT '粉丝openid',
  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_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`,`addon`) VALUES ('shop_statistics_follow','分销粉丝统计表','0','','1','["uid","duid","ctime","token"]','1:基础','','','','','','10','','','1443001407','1443002218','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','粉丝id','int(10) NULL','num','','','1','','0','shop_statistics_follow','0','1','1443001489','1443001489','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('duid','分销用户id','int(10) NULL','num','','','1','','0','shop_statistics_follow','0','1','1443001536','1443001536','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','1','','0','shop_statistics_follow','0','1','1443001584','1443001584','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_statistics_follow','0','1','1443001620','1443001620','','3','','regex','get_token','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_statistics_follow','0','1','1443010994','1443010994','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_servicer` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `uid`  int(10) NULL  COMMENT '用户选择',
  `truename`  varchar(255) NULL  COMMENT '真实姓名',
  `mobile`  varchar(255) NULL  COMMENT '手机号',
  `role`  varchar(100) NULL  DEFAULT 2 COMMENT '授权列表',
  `enable`  int(10) NULL  DEFAULT 1 COMMENT '是否启用',
  `token`  varchar(255) NULL  COMMENT 'token',
  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_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`,`addon`) VALUES ('servicer','授权用户','0','','1','["uid","truename","mobile","role","enable"]','1:基础','','','','','truename:姓名\r\nrole:权限列表\r\nnickname:微信名称\r\nenable|get_name_by_status:是否启用\r\nids:操作:set_enable?id=[id]&enable=[enable]|改变启用状态,[EDIT]|编辑,[DELETE]|删除','10','truename','','1443066649','1445932371','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户选择','int(10) NULL','user','','','1','','0','servicer','1','1','1445325351','1443066688','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('truename','真实姓名','varchar(255) NULL','string','','','1','','0','servicer','1','1','1445325390','1443066736','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('mobile','手机号','varchar(255) NULL','string','','','1','','0','servicer','1','1','1445325401','1443066833','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('role','授权列表','varchar(100) NULL','checkbox','2','','0','1:微信客服\r\n2:扫码验证\r\n3:微订单接单','0','servicer','0','1','1467284007','1443067065','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('enable','是否启用','int(10) NULL','radio','1','','1','0:禁用\r\n1:启用','0','servicer','0','1','1443067721','1443067149','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','servicer','0','1','1443067647','1443067638','','3','','regex','get_token','1','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_card_member` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username`  varchar(255) NULL  COMMENT '姓名',
  `phone`  varchar(255) NULL  COMMENT '手机号',
  `sex`  varchar(10) NULL  COMMENT '性别',
  `birthday`  int(10) NULL  COMMENT '生日',
  `address`  varchar(255) NULL  COMMENT '地址',
  `ctime`  int(10) NULL  COMMENT '导入时间',
  `is_get`  tinyint(2) NULL  DEFAULT 1 COMMENT '是否领取',
  `token`  varchar(255) NULL  COMMENT 'token',
  `shop_code`  varchar(255) NULL  COMMENT '地址编码',
  `score`  int(10) NULL  COMMENT '积分余额',
  `card_number`  varchar(255) 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_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`,`addon`) VALUES ('shop_card_member','实体店会员卡','0','','1','["username","phone","sex","birthday","address","ctime","is_get","token","shop_code","score","card_number"]','1:基础','','','','','username:姓名\r\nphone:手机号\r\nsex:性别\r\nbirthday|time_format:生日\r\naddress:地址\r\nscore:导入积分\r\ncard_number:绑定会员卡号\r\nctime|time_format:导入时间\r\nis_get|get_name_by_status:是否领取\r\nid:操作:changeGet&id=[id]&is_get=[is_get]|改变领取状态','10','username:请输入姓名','','1444362335','1453951928','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('username','姓名','varchar(255) NULL','string','','','1','','0','shop_card_member','1','1','1444362378','1444362378','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('phone','手机号','varchar(255) NULL','string','','','1','','0','shop_card_member','1','1','1444362399','1444362399','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sex','性别','varchar(10) NULL','string','','','1','','0','shop_card_member','0','1','1444362506','1444362506','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('birthday','生日','int(10) NULL','date','','','1','','0','shop_card_member','0','1','1444377105','1444362549','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('address','地址','varchar(255) NULL','string','','','1','','0','shop_card_member','0','1','1444362572','1444362572','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','1','','0','shop_card_member','0','1','1444363093','1444363093','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_get','是否领取','tinyint(2) NULL','bool','1','','1','0:否\r\n1:是','0','shop_card_member','0','1','1444377709','1444363783','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','1','','0','shop_card_member','0','1','1444363955','1444363955','','3','','regex','get_token','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_code','地址编码','varchar(255) NULL','string','','','1','','0','shop_card_member','0','1','1450168167','1450168167','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('score','积分余额','int(10) NULL','num','','','1','','0','shop_card_member','0','1','1450170325','1450170325','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('card_number','会员卡号','varchar(255) NULL','string','','','1','','0','shop_card_member','0','1','1450170431','1450170431','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_goods_comment` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id`  int(10) NULL  COMMENT '商品编号',
  `score`  int(10) NULL  DEFAULT 0 COMMENT '评价',
  `content`  text NULL  COMMENT '内容',
  `order_id`  int(10) NULL  COMMENT '订单编号',
  `uid`  int(10) NULL  COMMENT '用户uid',
  `pic`  varchar(255) NULL  COMMENT '图片',
  `cTime`  int(10) NULL  COMMENT '创建时间',
  `token`  varchar(255) NULL  COMMENT 'token',
  `shop_id`  int(10) NULL  COMMENT '商店编号',
  `is_show`  int(10) NULL  DEFAULT 1 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_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`,`addon`) VALUES ('shop_goods_comment','商品评论信息','0','','1','["goods_id","score","content","order_id","uid","cTime","shop_id","is_show"]','1:基础','','','','','id:10%编号\r\nuid|get_username:15%用户昵称\r\ncTime|time_format:15%评论时间\r\nscore:15%星星数\r\ncontent:25%评论内容\r\nis_show|get_name_by_status:10%是否显示\r\nids:编辑:changeShow?id=[id]&is_show=[is_show]&goods_id=[goods_id]|设置显示状态','10','','','1457430858','1458901414','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品编号','int(10) NULL','num','','','1','','0','shop_goods_comment','0','1','1457430893','1457430893','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('score','评价','int(10) NULL','num','0','','1','','0','shop_goods_comment','0','1','1457430920','1457430920','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('content','内容','text NULL','textarea','','','1','','0','shop_goods_comment','0','1','1457431008','1457431008','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('order_id','订单编号','int(10) NULL','num','','','1','','0','shop_goods_comment','0','1','1457431051','1457431051','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','用户uid','int(10) NULL','num','','','1','','0','shop_goods_comment','0','1','1457431069','1457431069','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('pic','图片','varchar(255) NULL','mult_picture','','','0','','0','shop_goods_comment','0','1','1457431109','1457431109','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','1','','0','shop_goods_comment','0','1','1457431143','1457431143','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_goods_comment','0','1','1457431241','1457431231','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商店编号','int(10) NULL','num','','','1','','0','shop_goods_comment','0','1','1457497837','1457497837','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('is_show','是否显示','int(10) NULL','num','1','','1','1:显示\r\n0:不显示','0','shop_goods_comment','0','1','1458900388','1458900388','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_goods_category_link` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `token`  varchar(255) NULL  COMMENT 'token',
  `goods_id`  int(10) NULL  COMMENT '商品编号',
  `shop_id`  int(10) NULL  COMMENT '商城编号',
  `sort`  int(10) NULL  DEFAULT 0 COMMENT '排序',
  `category_first`  int(10) NULL  COMMENT '一级分类',
  `category_second`  int(10) 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_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`,`addon`) VALUES ('goods_category_link','商品所属分类','0','','1','','1:基础','','','','','','10','','','1457933153','1457933153','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','goods_category_link','0','1','1457933196','1457933196','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品编号','int(10) NULL','num','','','1','','0','goods_category_link','0','1','1457933289','1457933289','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商城编号','int(10) NULL','num','','','1','','0','goods_category_link','0','1','1457933309','1457933309','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('sort','排序','int(10) NULL','num','0','','1','','0','goods_category_link','0','1','1457933331','1457933331','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('category_first','一级分类','int(10) NULL','num','','','1','','0','goods_category_link','0','1','1457933356','1457933356','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('category_second','二级分类','int(10) NULL','num','','','1','','0','goods_category_link','0','1','1457933378','1457933378','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_goods_param_link` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title`  varchar(255) NULL  COMMENT '参数名',
  `token`  varchar(255) NULL  COMMENT 'token',
  `goods_id`  int(10) NULL  COMMENT '商品编号',
  `param_value`  varchar(255) 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_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`,`addon`) VALUES ('goods_param_link','商品参数表','0','','1','','1:基础','','','','','','10','','','1457941322','1457941322','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('title','参数名','varchar(255) NULL','string','','','1','','0','goods_param_link','0','1','1457941454','1457941454','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','goods_param_link','0','1','1457941884','1457941884','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品编号','int(10) NULL','num','','','1','','0','goods_param_link','0','1','1457941904','1457941904','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('param_value','参数值','varchar(255) NULL','string','','','1','','0','goods_param_link','0','1','1457941938','1457941938','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_goods_store_link` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `goods_id`  int(10) NULL  COMMENT '商品编号',
  `store_id`  int(10) NULL  COMMENT '门店编号',
  `store_num`  int(10) NULL  DEFAULT 0 COMMENT '门店库存',
  `shop_id`  int(10) NULL  COMMENT '商城编号',
  `token`  varchar(255) NULL  COMMENT 'token',
  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_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`,`addon`) VALUES ('goods_store_link','商品所属门店','0','','1','','1:基础','','','','','','10','','','1458551555','1458551555','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('goods_id','商品编号','int(10) NULL','num','','','1','','0','goods_store_link','0','1','1458551595','1458551595','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('store_id','门店编号','int(10) NULL','num','','','1','','0','goods_store_link','0','1','1458551631','1458551631','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('store_num','门店库存','int(10) NULL','num','0','','1','','0','goods_store_link','0','1','1458551659','1458551659','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('shop_id','商城编号','int(10) NULL','num','','','1','','0','goods_store_link','0','1','1458551683','1458551683','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','goods_store_link','0','1','1458551700','1458551700','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  CREATE TABLE IF NOT EXISTS `wp_shop_user_level_link` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `cTime`  int(10) NULL  COMMENT '创建时间',
  `token`  varchar(255) NULL  COMMENT 'token',
  `uid`  int(10) NULL  COMMENT '分销用户',
  `upper_user`  int(10) NULL  COMMENT '上级分销用户',
  `level`  int(10) 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_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`,`addon`) VALUES ('shop_user_level_link','分销用户级别关系','0','','1','["uid","upper_user","level"]','1:基础','','','','','','10','','','1459826468','1459838196','1','MyISAM','Shop');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','datetime','','','0','','0','shop_user_level_link','0','1','1459826507','1459826507','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`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) NULL','string','','','0','','0','shop_user_level_link','0','1','1459826530','1459826530','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('uid','分销用户','int(10) NULL','num','','','1','','0','shop_user_level_link','0','1','1459826580','1459826568','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('upper_user','上级分销用户','int(10) NULL','num','','','1','','0','shop_user_level_link','0','1','1459826630','1459826630','','3','','regex','','3','function');
  INSERT INTO `wp_attribute` (`name`,`title`,`field`,`type`,`value`,`remark`,`is_show`,`extra`,`model_id`,`model_name`,`is_must`,`status`,`update_time`,`create_time`,`validate_rule`,`validate_time`,`error_info`,`validate_type`,`auto_rule`,`auto_time`,`auto_type`) VALUES ('level','分销级别','int(10) NULL','num','','','1','1:一级分销商\r\n2:二级分销商\r\n3:三级分销商','0','shop_user_level_link','0','1','1459826703','1459826683','','3','','regex','','3','function');
  UPDATE `wp_attribute` SET model_id= (SELECT MAX(id) FROM `wp_model`) WHERE model_id=0;
  
  
  