视多云商城历史各版本升级SQL语句汇总
视多官方
发布于 2019-11-16
5.3.4
注意:此版本开始将使用PHP7.3,请大家先宝塔安装PHP7.3,然后安装fileinfo和sg11插件,并将网站的php版本切换成7.3
ALTER TABLE `sd_goods` ADD `password` VARCHAR(15) NOT NULL DEFAULT '0';
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('23', 'payTitle', '0');
ALTER TABLE `sd_user` ADD `last_login_ip` VARCHAR(255) NOT NULL DEFAULT '0.0.0.0';
ALTER TABLE `sd_user` ADD `reg_ip` VARCHAR(255) NOT NULL DEFAULT '0.0.0.0';
ALTER TABLE `sd_user` ADD `last_login_time` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `sd_log` ADD `ip_addr` VARCHAR(150) NOT NULL DEFAULT '未知归属地';
ALTER TABLE `sd_goods` ADD `api_price` DECIMAL(10,2) NOT NULL DEFAULT '0.00';
ALTER TABLE `sd_goods` CHANGE `dailiprice` `memberPrice` DECIMAL(6,2) NOT NULL DEFAULT '0.00' COMMENT '会员价';
ALTER TABLE `sd_goods` CHANGE `highdailiprice` `seniorMemberPrice` DECIMAL(10,2) NOT NULL;
5.3.3
ALTER TABLE `sd_options` ADD `background` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `sd_goods` ADD `count_set` INT(1) NOT NULL DEFAULT '1';
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('19', 'TouristVoucher', '1');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('20', 'TouristVoucherMsg', '请输入11位手机号');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('21', 'SubMaxProfit', '0');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('22', 'SubMinProfit', '0');
5.3.2
INSERT INTO `sd_pay` (`id`, `payname`, `payurl`, `appid`, `appkey1`, `appkey2`, `appkey3`) VALUES ('11', 'xunhupay', '', '123456', 'abcdefg', '', '');
5.3.1
CREATE TABLE `sd_subprofit` ( `id` INT(11) NOT NULL , `sub_id` VARCHAR(10) NOT NULL , `order_id` VARCHAR(32) NOT NULL , `money` DECIMAL(10,2) NOT NULL , `time` TIMESTAMP NOT NULL ) ENGINE = InnoDB;
ALTER TABLE `sd_subprofit` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_subprofit` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `sd_order` CHANGE `sub_profit` `sub_profit` INT(1) NOT NULL DEFAULT '0';
ALTER TABLE `sd_subprofit` ADD `status` INT(1) NOT NULL DEFAULT '0';
ALTER TABLE `sd_subprofit` ADD `user_id` VARCHAR(10) NOT NULL;
ALTER TABLE `sd_subprofit` ADD INDEX( `sub_id`, `order_id`);
ALTER TABLE `sd_subprofit` ADD INDEX( `order_id`);
ALTER TABLE `sd_subprofit` ADD INDEX( `time`, `status`, `user_id`);
ALTER TABLE `sd_subprofit` ADD INDEX( `status`, `user_id`);
5.3.0
ALTER TABLE `sd_order` DROP `yeskm`;
ALTER TABLE `sd_order` ADD `sub_id` VARCHAR(10) NOT NULL DEFAULT '0';
5.2.9
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('14', 'mobile_tpl', '1');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('15', 'pc_tpl', '1');
ALTER TABLE `sd_options` DROP `indexmode`;
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('16', 'order_time_limit', '1');
ALTER TABLE `sd_subgood` ADD INDEX( `cat`, `userid`);
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('17', 'withdraw_fee', '0.01');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('18', 'withdraw_lowest', '10');
5.2.8
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES (10, 'order_safe_ip', '1');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('11', 'order_safe_only_order_id', '0');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('12', 'order_safe_password', '1');
ALTER TABLE `sd_api` ADD `retail_profit` DECIMAL(6,2) NOT NULL DEFAULT '1.00', ADD `high_profit` DECIMAL(6,2) NOT NULL DEFAULT '1.00', ADD `ordinary_profit` DECIMAL(6,2) NOT NULL DEFAULT '1.00';
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('13', 'open_key', '0');
5.2.7
ALTER TABLE `sd_order` ADD `is_api` INT(1) NOT NULL DEFAULT '0';
5.2.6
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES (4, 'qq', '123456');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('5', 'weixin', '123456');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('6', 'worker_hour', '早9到晚上10(工作日除外)');
ALTER TABLE `sd_options` DROP `qq`;
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('7', 'home_wholesale', '1');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('8', 'wo_sys', '1');
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('9', 'discount', '1');
5.2.5
ALTER TABLE `sd_categories` ADD `abbr` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '分类简称';
ALTER TABLE `sd_goods` ADD `color` VARCHAR(15) NOT NULL DEFAULT '#6f7070' AFTER `name`;
CREATE TABLE `sd_wo` ( `id` INT(11) NOT NULL , `order_id` VARCHAR(50) NOT NULL , `type` VARCHAR(10) NOT NULL , `content` TEXT NOT NULL , `time` TIMESTAMP NOT NULL , `ip` VARCHAR(200) NOT NULL ) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `sd_wo` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_wo` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
CREATE TABLE `sd_wo_comment` ( `id` INT NOT NULL , `order_id` VARCHAR(50) NOT NULL , `content` TEXT NOT NULL , `time` TIMESTAMP NOT NULL , `ip` VARCHAR(50) NOT NULL ) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `sd_wo_comment` ADD `role` INT(1) NOT NULL DEFAULT '1';
ALTER TABLE `sd_wo_comment` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_wo_comment` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES (3, 'open_sub', '100');
ALTER TABLE `sd_api` DROP `api_id`, DROP `api_key`;
CREATE TABLE `sd_api_site` ( `id` INT NOT NULL , `name` VARCHAR(50) NOT NULL , `api_id` VARCHAR(50) NOT NULL , `api_key` VARCHAR(50) NOT NULL ) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `sd_api_site` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_api_site` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `sd_api` ADD `site_id` VARCHAR(5) NOT NULL;
ALTER TABLE `sd_api_site` ADD `api_url` VARCHAR(255) NOT NULL;
ALTER TABLE `sd_api` DROP `api_url`;
ALTER TABLE `sd_api_site` ADD `type` INT(2) NOT NULL;
ALTER TABLE `sd_api` DROP `type`;
TRUNCATE `sd_api`;
5.2.4
不需要
5.2.3
不需要
5.2.2
不需要
5.21
不需要
5.20
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES ('2', 'protocol', '0');
还需要在网站根目录下的.env文件里添加以下内容:
PC_TPL=default_pc
MOBILE_TPL=default_mobile
5.19
INSERT INTO `sd_pay` (`id`, `payname`, `payurl`, `appid`, `appkey1`, `appkey2`, `appkey3`) VALUES ('10', 'xorpay', 'https://xorpay.com', '1', '1', '1', '1');
5.18
不需要
5.17
CREATE TABLE `sd_subgood` ( `id` INT(11) NOT NULL , `gid` INT(11) NOT NULL , `profit` DECIMAL(10,2) NOT NULL , `cat` VARCHAR(255) NOT NULL , `userid` INT(11) NOT NULL , `sort` INT(11) NOT NULL ) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `sd_subgood` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_subgood` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
CREATE TABLE `sd_substation` ( `id` INT(11) NOT NULL , `name` VARCHAR(255) NOT NULL , `url` VARCHAR(255) NOT NULL , `qq` VARCHAR(15) NOT NULL , `keywords` VARCHAR(255) NOT NULL , `description` VARCHAR(255) NOT NULL , `userid` INT(11) NOT NULL , `status` INT(1) NOT NULL , `logo` VARCHAR(255) NOT NULL , `theme` INT(1) NOT NULL , `template` INT(1) NOT NULL , `gonggao` TEXT NOT NULL ) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `sd_substation` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_substation` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `sd_order` ADD `sub_profit` DECIMAL(10,2) NOT NULL AFTER `multiple`;
ALTER TABLE `sd_order` CHANGE `sub_profit` `sub_profit` DECIMAL(10,2) NOT NULL DEFAULT '0.00';
ALTER TABLE `sd_substation` CHANGE `theme` `theme` INT(1) NOT NULL DEFAULT '1';
ALTER TABLE `sd_substation` CHANGE `template` `template` INT(1) NOT NULL DEFAULT '1';
5.16
CREATE TABLE `sd_workorder` ( `id` INT(11) NOT NULL , `orderid` VARCHAR(50) NOT NULL , `title` VARCHAR(255) NOT NULL , `content` TEXT NOT NULL , `time` TIMESTAMP NOT NULL , `responder` VARCHAR(50) NOT NULL , `host` VARCHAR(1) NOT NULL , `ip` VARCHAR(200) NOT NULL DEFAULT '0.0.0.0' ) ENGINE = MyISAM;
ALTER TABLE `sd_workorder` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_workorder` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
INSERT INTO `sd_pay` (`id`, `payname`, `payurl`, `appid`, `appkey1`, `appkey2`, `appkey3`) VALUES ('9', 'wechat', 'https://pay.weixin.qq.com/', '1', '1', '1', '1');
ALTER TABLE `sd_options` DROP `goodgg`;
ALTER TABLE `sd_options` ADD `unionpay` INT(1) NOT NULL DEFAULT '0';
5.1.5
ALTER TABLE `sd_goods` ADD `cost` DECIMAL(10,2) NOT NULL DEFAULT '0.00';
5.1.4
ALTER TABLE `sd_goods` ADD `pifa` VARCHAR(255) NOT NULL DEFAULT '{\"status\":\"0\",\"one_num\":\"0\",\"one_price\":\"0\",\"two_num\":\"0\",\"two_price\":\"0\"}';
ALTER TABLE `sd_goods` DROP `mansl`, DROP `yhprice`, DROP `minsl`, DROP `mansl2`, DROP `yhprice2`;
ALTER TABLE `sd_goods` ADD `buycount` VARCHAR(255) NOT NULL DEFAULT '{\"userday\":\"0\",\"usertotal\":\"0\",\"min\":\"0\",\"max\":\"0\"}';
5.1.3
ALTER TABLE `sd_handinfo` ADD `notify` VARCHAR(150) NULL;
5.1.2
CREATE TABLE `sd_card` ( `id` INT(11) NOT NULL , `card_m` VARCHAR(32) NOT NULL COMMENT '充值卡号' , `card_p` VARCHAR(32) NOT NULL COMMENT '充值密码' , `add_time` TIMESTAMP NOT NULL COMMENT '生成时间' , `use_time` TIMESTAMP NULL COMMENT '使用时间' , `status` INT(1) NOT NULL COMMENT '状态' , `user_id` VARCHAR(10) NULL COMMENT '使用会员' ) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `sd_card` ADD `money` DECIMAL(10,2) NOT NULL;
ALTER TABLE `sd_card` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_card` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
CREATE TABLE `sd_set` ( `id` INT(11) NOT NULL , `set_name` VARCHAR(255) NOT NULL , `set_value` VARCHAR(255) NOT NULL ) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE `sd_set` ADD PRIMARY KEY( `id`);
ALTER TABLE `sd_set` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;
INSERT INTO `sd_set` (`id`, `set_name`, `set_value`) VALUES (NULL, 'buy_card_url', '');
INSERT INTO `sd_pay` (`id`, `payname`, `payurl`, `appid`, `appkey1`, `appkey2`, `appkey3`) VALUES ('8', 'zzpay', 'http://', '0', 'a7cc8678193ee9c70ae3d75fd04ae999', '', '');
5.1.1
无需执行SQL语句,但是此次升级需要在.env文件中添加以下内容:
VERIFY=20
5.1.0
无需执行SQL语句
5.0.7
无需执行SQL语句
5.0.6
CREATE TABLE `sd_handinfo` ( `id` INT(11) NOT NULL AUTO_INCREMENT , `gid` VARCHAR(11) NOT NULL , `orderid` VARCHAR(32) NOT NULL , `info` TEXT NOT NULL , `status` VARCHAR(5) NOT NULL , `msg` VARCHAR(255) NULL , PRIMARY KEY (`id`)) ENGINE = MyISAM;
ALTER TABLE `sd_article` ADD `authority` INT(1) NULL DEFAULT '0' COMMENT '0不限制 1限制会员' AFTER `content`;
ALTER TABLE `sd_order` CHANGE `count` `count` INT(11) NOT NULL DEFAULT '1' COMMENT '购买数量';
ALTER TABLE `sd_goods` ADD `multiple` INT(11) NOT NULL DEFAULT '1';
ALTER TABLE `sd_order` ADD `multiple` INT(11) NOT NULL DEFAULT '1';
DELETE FROM `sd_order` WHERE `goodtype`='d';
升级此版本会清空你网站所有的代充订单!!!卡密订单不影响!!!
5.0.5
无需执行SQL语句
5.0.4:
无需执行SQL语句
5.0.3:
ALTER TABLE sd_api ADD type VARCHAR(5) NOT NULL DEFAULT '1' COMMENT '1视多发卡,2waa发卡' ;
CREATE TABLE sd_record ( id INT NOT NULL AUTO_INCREMENT , content VARCHAR(100) NOT NULL , money DECIMAL(10,2) NOT NULL , before_money DECIMAL(10,2) NOT NULL , after_money DECIMAL(10,2) NOT NULL , time TIMESTAMP NOT NULL , PRIMARY KEY (id)) ENGINE = MyISAM CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT = '会员资金流水';
ALTER TABLE sd_record ADD userId VARCHAR(10) NOT NULL;
5.0.2
ALTER TABLE sd_user ADD appkey VARCHAR(32) NULL;
CREATE TABLE sd_api ( id INT(11) NOT NULL AUTO_INCREMENT , gid VARCHAR(20) NOT NULL , api_gid VARCHAR(20) NOT NULL , api_url VARCHAR(255) NOT NULL , api_id VARCHAR(20) NOT NULL , api_key VARCHAR(32) NOT NULL , PRIMARY KEY (id)) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;
ALTER TABLE sd_discount CHANGE ddid ddid VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '使用订单号';
ALTER TABLE sd_order CHANGE status status VARCHAR(20) NOT NULL DEFAULT '0';
INSERT INTO sd_pay (id, payname, payurl, appid, appkey1, appkey2, appkey3) VALUES (NULL, 'payjs', '', '1', '1', '', '');
5.0.1
无需执行SQL语句
5.0.0
此次升级会将你的后台密码重置为admin,升级完毕后请用新密码admin登陆,登陆成功后请修改密码
执行下面的SQL前,前请手动先把sd_recharge这个表删掉,删掉后再执行下面的语句,请注意,此操作将会删除所有用户的充值记录
RENAME TABLE `sd_daili` TO `sd_user`;
RENAME TABLE `sd_oper` TO `sd_log`;
CREATE TABLE sd_recharge (
id int(11) NOT NULL,
rechargeId varchar(32) NOT NULL COMMENT '充值订单号',
userId varchar(10) NOT NULL COMMENT '用户ID',
money decimal(10,2) NOT NULL DEFAULT '0.01' COMMENT '充值金额',
type varchar(10) NOT NULL DEFAULT 'alipay' COMMENT '支付方式',
time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '充值时间',
status int(1) NOT NULL DEFAULT '0' COMMENT '状态'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE sd_recharge
ADD PRIMARY KEY (id),
ADD KEY rechargeId (rechargeId),
ADD KEY userId (userId);
ALTER TABLE sd_recharge
MODIFY id int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
ALTER TABLE sd_options CHANGE adminpass adminpass VARCHAR(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '后台密码';
UPDATE sd_options SET adminpass = '$2y$10$9phNq7Hpu6uIGbpdti1XXerPseJDgVZfutrirtZauah.TcxBa9Cua' WHERE sd_options.id = 1;
ALTER TABLE sd_order ADD password VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '123456';
ALTER TABLE sd_kami ADD addtime TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE sd_user ADD qqkey VARCHAR(32) NOT NULL DEFAULT '0' ;
最新回复 (0)
137 主题数 |
59 帖子数 |
精华数 0 |