初始化代码
This commit is contained in:
166
app/member/info/UpdateSql.php
Normal file
166
app/member/info/UpdateSql.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
//获取表前缀
|
||||
$prefix = longbing_get_prefix();
|
||||
|
||||
//每个一个sql语句结束,都必须以英文分号结束。因为在执行sql时,需要分割单个脚本执行。
|
||||
//表前缀需要自己添加{$prefix} 以下脚本被测试脚本
|
||||
|
||||
|
||||
$sql = <<<updateSql
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_config` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`status` int(11) DEFAULT '0' COMMENT '会员开关',
|
||||
`growth_title` varchar(255) DEFAULT '' COMMENT '成长值名称',
|
||||
`growth_cash` varchar(11) DEFAULT '0' COMMENT '消费多少元增加成长值',
|
||||
`growth_order` varchar(11) DEFAULT '0' COMMENT '每笔订单增加多少',
|
||||
`growth_balance` varchar(11) DEFAULT '0' COMMENT '储值增加多少',
|
||||
`growth_limit` int(11) DEFAULT '0' COMMENT '储值开关',
|
||||
`growth_day_max` int(11) DEFAULT '0' COMMENT '每日最多增加多少',
|
||||
`integral_title` varchar(255) DEFAULT '' COMMENT '积分展示名称',
|
||||
`integral_cash` varchar(11) DEFAULT '0' COMMENT '每消费一元获得多少积分',
|
||||
`integral_limit` int(11) DEFAULT '0' COMMENT '积分限制',
|
||||
`integral_day_max` varchar(11) DEFAULT '0' COMMENT '每日最多获取多少积分',
|
||||
`explain` text COMMENT '说明',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员设置';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_growth` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`user_id` int(11) DEFAULT '0' COMMENT '用户id',
|
||||
`controller` varchar(128) DEFAULT '0' COMMENT '操作者',
|
||||
`growth_add` int(11) DEFAULT '0' COMMENT '新增成长值',
|
||||
`growth_before` int(11) DEFAULT '0' COMMENT '当前成长值',
|
||||
`growth_after` int(11) DEFAULT '0' COMMENT '修改后的成长值',
|
||||
`is_del` int(11) DEFAULT '0' COMMENT '是否清空',
|
||||
`is_member` int(11) DEFAULT '0' COMMENT '成为会员',
|
||||
`status` int(11) DEFAULT '1' COMMENT '状态',
|
||||
`create_time` int(11) DEFAULT '0' COMMENT '创建时间',
|
||||
`order_id` int(11) DEFAULT '0' COMMENT '订单状态',
|
||||
`goods_id` int(11) DEFAULT '0' COMMENT '商品id',
|
||||
`type` int(11) DEFAULT '1' COMMENT '类型',
|
||||
`controller_type` int(11) DEFAULT '0' COMMENT '操作类型',
|
||||
`update_time` int(11) DEFAULT '0',
|
||||
`refund` int(11) DEFAULT '0' COMMENT '是否退款',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_integral` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`user_id` int(11) DEFAULT '0' COMMENT '用户id',
|
||||
`controller` int(11) DEFAULT '0' COMMENT '操作者',
|
||||
`integral_add` int(11) DEFAULT '0' COMMENT '增减积分',
|
||||
`integral_before` int(11) DEFAULT '0' COMMENT '当前积分',
|
||||
`create_time` int(11) DEFAULT '0',
|
||||
`status` int(11) DEFAULT '0',
|
||||
`integral_after` int(11) DEFAULT '0',
|
||||
`order_id` int(11) DEFAULT '0' COMMENT '订单id',
|
||||
`type` int(11) DEFAULT '0',
|
||||
`controller_type` int(11) DEFAULT '0',
|
||||
`update_time` int(11) DEFAULT '0',
|
||||
`refund` int(11) DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_level` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`title` varchar(11) DEFAULT '' COMMENT '等级名字',
|
||||
`color` varchar(32) DEFAULT '0' COMMENT '背景颜色',
|
||||
`growth` int(11) DEFAULT '0' COMMENT '成长值',
|
||||
`discount` varchar(11) DEFAULT '0' COMMENT '消费折扣',
|
||||
`integral` varchar(11) DEFAULT '0' COMMENT '积分回馈倍率',
|
||||
`send_integral` varchar(11) DEFAULT '0' COMMENT '赠送积分',
|
||||
`is_goods` int(11) DEFAULT '0' COMMENT '买商品赠送会员开关',
|
||||
`status` int(11) DEFAULT '0',
|
||||
`create_time` int(11) DEFAULT '0',
|
||||
`update_time` int(11) DEFAULT '0',
|
||||
`top` int(11) DEFAULT '0' COMMENT '会员等级',
|
||||
`discount_switch` int(11) DEFAULT '0' COMMENT '消费折扣开关',
|
||||
`integral_switch` int(11) DEFAULT '0' COMMENT '积分回馈倍率开关',
|
||||
`send_integral_switch` int(11) DEFAULT '0' COMMENT '赠送积分开关',
|
||||
`upgrade_integral` int(11) DEFAULT '0' COMMENT '升级赠送积分',
|
||||
`upgrade_integral_switch` int(11) DEFAULT '0' COMMENT '升级赠送积分开关',
|
||||
`custom_rights_switch` int(11) DEFAULT '0' COMMENT '自定义权限开关',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员等级表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_list` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`user_id` int(11) DEFAULT NULL,
|
||||
`create_time` int(11) DEFAULT '0' COMMENT '创建时间',
|
||||
`growth` int(11) DEFAULT '0' COMMENT '成长值',
|
||||
`status` int(11) DEFAULT '1' COMMENT '状态',
|
||||
`update_time` int(11) DEFAULT '0' COMMENT '更新时间',
|
||||
`integral` int(11) DEFAULT '0' COMMENT '会员积分',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_rights` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`title` varchar(225) DEFAULT '' COMMENT '权益名称',
|
||||
`show_title` varchar(255) DEFAULT '' COMMENT '展示名称',
|
||||
`icon` varchar(255) DEFAULT '' COMMENT '标志',
|
||||
`content` text COMMENT '简介',
|
||||
`top` int(11) DEFAULT '0' COMMENT '排序',
|
||||
`type` int(11) DEFAULT '0' COMMENT '服务方式',
|
||||
`status` int(11) DEFAULT '0',
|
||||
`create_time` int(11) DEFAULT '0',
|
||||
`update_time` int(11) DEFAULT '0',
|
||||
`use_type` int(11) DEFAULT '0' COMMENT '类型(1商品打折,2积分倍率想,3积分赠送)',
|
||||
`is_up` int(11) DEFAULT '0' COMMENT '升级赠送礼包',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员权益表';
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_rights_relation` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`rights_id` int(11) DEFAULT '0' COMMENT '权益id',
|
||||
`member_id` int(11) DEFAULT '0' COMMENT '等级id',
|
||||
`type` int(11) DEFAULT '0' COMMENT '类型',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE `{$prefix}longbing_card_member_level` ADD COLUMN `coupon_switch` int(11) DEFAULT '0' COMMENT '优惠券开关';
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_v2_member_coupon` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uniacid` int(11) DEFAULT NULL,
|
||||
`member_id` int(11) DEFAULT '0' COMMENT '等级的id',
|
||||
`coupon_id` int(11) DEFAULT '0' COMMENT '优惠券id',
|
||||
`num` int(11) DEFAULT '0' COMMENT '数量',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
updateSql;
|
||||
|
||||
|
||||
|
||||
|
||||
return $sql;
|
||||
Reference in New Issue
Block a user