使用文档

问答插件升级v3.0

创建于 2023-11-08 / 922
字体: [默认] [大] [更大]

1. 先到商城后台,左侧 工具->sql控制台 执行以下sql

# v3.0.0
# 问答评论 - 问答
CREATE TABLE IF NOT EXISTS `{PREFIX}plugins_ask_comments` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `ask_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答id',
  `ask_comments_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答评论id',
  `reply_comments_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '一级回复评论id',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0待审核、1已审核、2已隐藏)',
  `md5_key` char(32) NOT NULL DEFAULT '' COMMENT '数据唯一md5key',
  `content` text COMMENT '评论内容',
  `comments_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '评论总数',
  `give_thumbs_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '点赞总数',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `ask_id` (`ask_id`),
  KEY `ask_comments_id` (`ask_comments_id`),
  KEY `reply_comments_id` (`reply_comments_id`),
  KEY `status` (`status`),
  KEY `md5_key` (`md5_key`),
  KEY `comments_count` (`comments_count`),
  KEY `give_thumbs_count` (`give_thumbs_count`)
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='问答评论 - 问答';

# 问答点赞 - 问答
CREATE TABLE IF NOT EXISTS `{PREFIX}plugins_ask_give_thumbs` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `ask_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答id',
  `ask_comments_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答评论id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `ask_id` (`ask_id`),
  KEY `ask_comments_id` (`ask_comments_id`)
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='问答点赞 - 问答';

# 问答发布奖励积分日志
CREATE TABLE IF NOT EXISTS `{PREFIX}plugins_ask_give_integral_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `ask_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `integral` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '奖励积分',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `ask_id` (`ask_id`),
  KEY `user_id` (`user_id`),
  KEY `integral` (`integral`),
  KEY `add_time` (`add_time`)
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='问答发布奖励积分日志 - 问答';

# 问答评论奖励积分日志
CREATE TABLE IF NOT EXISTS `{PREFIX}plugins_ask_comments_give_integral_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `ask_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答id',
  `comments_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '评论id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `integral` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '奖励积分',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `ask_id` (`ask_id`),
  KEY `comments_id` (`comments_id`),
  KEY `user_id` (`user_id`),
  KEY `integral` (`integral`),
  KEY `add_time` (`add_time`)
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='问答评论奖励积分日志 - 问答';

# 问答点赞奖励积分日志
CREATE TABLE IF NOT EXISTS `{PREFIX}plugins_ask_thumbs_give_integral_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `ask_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答id',
  `comments_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '问答id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `integral` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '奖励积分',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `ask_id` (`ask_id`),
  KEY `comments_id` (`comments_id`),
  KEY `user_id` (`user_id`),
  KEY `integral` (`integral`),
  KEY `add_time` (`add_time`)
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='问答点赞奖励积分日志 - 问答';


# 表重命名
RENAME TABLE `{PREFIX}answer` TO `{PREFIX}plugins_ask`;
RENAME TABLE `{PREFIX}plugins_answers_goods` TO `{PREFIX}plugins_ask_goods`;
RENAME TABLE `{PREFIX}plugins_answers_slider` TO `{PREFIX}plugins_ask_slider`;

# 插件名称
UPDATE `{PREFIX}plugins` SET `plugins`='ask' WHERE `plugins`='answers';
UPDATE `{PREFIX}attachment` SET `path_type`='plugins_ask' WHERE `path_type`='plugins_answers';

# 问答新增评论和点赞总数
ALTER TABLE `{PREFIX}plugins_ask` add `comments_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '评论总数' after `access_count`;
ALTER TABLE `{PREFIX}plugins_ask` add `give_thumbs_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点赞总数' after `comments_count`;

# 问答新增商品id
ALTER TABLE `{PREFIX}plugins_ask` add `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id' after `user_id`;

2. 然后再去商店在线安装问答增强版插件

80 人点赞过