文件
xionggeshop/addons/shopro_wechat_trade/install.sql

40 行
1.7 KiB
SQL

-- Shopro 微信交易合规插件
CREATE TABLE IF NOT EXISTS `__PREFIX__shopro_wechat_trade_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`value` text,
`group` varchar(50) DEFAULT 'basic',
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信交易合规配置';
CREATE TABLE IF NOT EXISTS `__PREFIX__shopro_wechat_trade_sync` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT 0,
`order_sn` varchar(64) NOT NULL DEFAULT '',
`order_item_id` int(11) NOT NULL DEFAULT 0,
`sync_type` varchar(16) NOT NULL DEFAULT 'shipping' COMMENT 'shipping/confirm',
`status` varchar(16) NOT NULL DEFAULT 'pending' COMMENT 'pending/success/failed',
`delivery_mode` tinyint(1) NOT NULL DEFAULT 1,
`request_payload` text,
`response_payload` text,
`errcode` int(11) DEFAULT NULL,
`errmsg` varchar(255) DEFAULT NULL,
`retry_count` int(11) NOT NULL DEFAULT 0,
`next_retry_time` int(10) DEFAULT NULL,
`createtime` int(10) NOT NULL,
`updatetime` int(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`),
KEY `order_sn` (`order_sn`),
KEY `status_retry` (`status`, `next_retry_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='微信发货/确认收货同步日志';
INSERT IGNORE INTO `__PREFIX__shopro_wechat_trade_config` (`name`, `value`, `group`, `description`) VALUES
('wechat_trade_enable', '1', 'basic', '微信交易合规总开关'),
('order_detail_path', 'pages/order/detail?id=${商品订单号}', 'basic', '购物订单跳转路径'),
('max_retry', '5', 'basic', '失败最大重试次数'),
('retry_interval', '300', 'basic', '重试间隔秒');