同步代码

This commit is contained in:
邹景立 2021-06-17 13:17:32 +08:00
parent 95236e9b9f
commit 19eadbcbad
32 changed files with 8840 additions and 4876 deletions

View File

@ -1,27 +1,13 @@
/*
Navicat MySQL Data Transfer
Source Server : anyon.localhost
Source Server Type : MySQL
Source Server Version : 80018
Source Host : localhost:3306
Source Schema : admin_v6
Target Server Type : MySQL
Target Server Version : 80018
File Encoding : 65001
Date: 10/05/2021 12:18:58
*/
SET NAMES utf8mb4; SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; SET
FOREIGN_KEY_CHECKS = 0;
-- ---------------------------- -- ----------------------------
-- Table structure for base_postage_company -- Table structure for base_postage_company
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `base_postage_company`; DROP TABLE IF EXISTS `base_postage_company`;
CREATE TABLE `base_postage_company` ( CREATE TABLE `base_postage_company`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司名称', `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司名称',
`code_1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司代码', `code_1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司代码',
@ -38,34 +24,42 @@ CREATE TABLE `base_postage_company` (
INDEX `idx_base_postage_company_code3` (`code_3`) USING BTREE, INDEX `idx_base_postage_company_code3` (`code_3`) USING BTREE,
INDEX `idx_base_postage_company_status` (`status`) USING BTREE, INDEX `idx_base_postage_company_status` (`status`) USING BTREE,
INDEX `idx_base_postage_company_deleted` (`deleted`) USING BTREE INDEX `idx_base_postage_company_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-公司' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 31
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-公司';
-- ---------------------------- -- ----------------------------
-- Table structure for base_postage_region -- Table structure for base_postage_region
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `base_postage_region`; DROP TABLE IF EXISTS `base_postage_region`;
CREATE TABLE `base_postage_region` ( CREATE TABLE `base_postage_region`
(
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`pid` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '上级PID', `pid` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '上级PID',
`first` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '首字母', `first` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '首字母',
`short` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域简称', `short` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域简称',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域名称', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域名称',
`level` tinyint(4) NULL DEFAULT 0 COMMENT '区域层级',
`pinyin` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域拼音',
`code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域邮编',
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '使用状态',
`lng` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在经度', `lng` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在经度',
`lat` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在纬度', `lat` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在纬度',
`code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域邮编',
`level` tinyint(4) NULL DEFAULT 0 COMMENT '区域层级',
`pinyin` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域拼音',
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '使用状态',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_base_postage_region_pid` (`pid`) USING BTREE, INDEX `idx_base_postage_region_pid` (`pid`) USING BTREE,
INDEX `idx_base_postage_region_name` (`name`) USING BTREE INDEX `idx_base_postage_region_name` (`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4019 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-区域' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 4019
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-区域';
-- ---------------------------- -- ----------------------------
-- Table structure for base_postage_template -- Table structure for base_postage_template
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `base_postage_template`; DROP TABLE IF EXISTS `base_postage_template`;
CREATE TABLE `base_postage_template` ( CREATE TABLE `base_postage_template`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '模板编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '模板编号',
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '模板名称', `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '模板名称',
@ -79,13 +73,17 @@ CREATE TABLE `base_postage_template` (
INDEX `idx_base_postage_template_code` (`code`) USING BTREE, INDEX `idx_base_postage_template_code` (`code`) USING BTREE,
INDEX `idx_base_postage_template_status` (`status`) USING BTREE, INDEX `idx_base_postage_template_status` (`status`) USING BTREE,
INDEX `idx_base_postage_template_deleted` (`deleted`) USING BTREE INDEX `idx_base_postage_template_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-模板' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-模板';
-- ---------------------------- -- ----------------------------
-- Table structure for base_user_discount -- Table structure for base_user_discount
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `base_user_discount`; DROP TABLE IF EXISTS `base_user_discount`;
CREATE TABLE `base_user_discount` ( CREATE TABLE `base_user_discount`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '方案名称', `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '方案名称',
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '方案规则', `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '方案规则',
@ -97,13 +95,17 @@ CREATE TABLE `base_user_discount` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_base_user_discount_status` (`status`) USING BTREE, INDEX `idx_base_user_discount_status` (`status`) USING BTREE,
INDEX `idx_base_user_discount_deleted` (`deleted`) USING BTREE INDEX `idx_base_user_discount_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-折扣' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 2
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-折扣';
-- ---------------------------- -- ----------------------------
-- Table structure for base_user_message -- Table structure for base_user_message
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `base_user_message`; DROP TABLE IF EXISTS `base_user_message`;
CREATE TABLE `base_user_message` ( CREATE TABLE `base_user_message`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息类型', `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息类型',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息名称', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息名称',
@ -117,13 +119,17 @@ CREATE TABLE `base_user_message` (
INDEX `idx_base_user_message_type` (`type`) USING BTREE, INDEX `idx_base_user_message_type` (`type`) USING BTREE,
INDEX `idx_base_user_message_status` (`status`) USING BTREE, INDEX `idx_base_user_message_status` (`status`) USING BTREE,
INDEX `idx_base_user_message_deleted` (`deleted`) USING BTREE INDEX `idx_base_user_message_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-通知' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 3
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-通知';
-- ---------------------------- -- ----------------------------
-- Table structure for base_user_payment -- Table structure for base_user_payment
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `base_user_payment`; DROP TABLE IF EXISTS `base_user_payment`;
CREATE TABLE `base_user_payment` ( CREATE TABLE `base_user_payment`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付类型', `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付类型',
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '通道编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '通道编号',
@ -140,13 +146,17 @@ CREATE TABLE `base_user_payment` (
INDEX `idx_base_user_payment_code` (`code`) USING BTREE, INDEX `idx_base_user_payment_code` (`code`) USING BTREE,
INDEX `idx_base_user_payment_status` (`status`) USING BTREE, INDEX `idx_base_user_payment_status` (`status`) USING BTREE,
INDEX `idx_base_user_payment_deleted` (`deleted`) USING BTREE INDEX `idx_base_user_payment_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-支付' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 7
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-支付';
-- ---------------------------- -- ----------------------------
-- Table structure for base_user_upgrade -- Table structure for base_user_upgrade
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `base_user_upgrade`; DROP TABLE IF EXISTS `base_user_upgrade`;
CREATE TABLE `base_user_upgrade` ( CREATE TABLE `base_user_upgrade`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户级别名称', `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户级别名称',
`number` tinyint(2) NULL DEFAULT 0 COMMENT '用户级别序号', `number` tinyint(2) NULL DEFAULT 0 COMMENT '用户级别序号',
@ -169,13 +179,17 @@ CREATE TABLE `base_user_upgrade` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_base_user_upgrade_status` (`status`) USING BTREE, INDEX `idx_base_user_upgrade_status` (`status`) USING BTREE,
INDEX `idx_base_user_upgrade_number` (`number`) USING BTREE INDEX `idx_base_user_upgrade_number` (`number`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-等级' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 6
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-等级';
-- ---------------------------- -- ----------------------------
-- Table structure for data_news_item -- Table structure for data_news_item
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_news_item`; DROP TABLE IF EXISTS `data_news_item`;
CREATE TABLE `data_news_item` ( CREATE TABLE `data_news_item`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章编号',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章标题', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章标题',
@ -195,13 +209,17 @@ CREATE TABLE `data_news_item` (
INDEX `idx_data_news_item_code` (`code`) USING BTREE, INDEX `idx_data_news_item_code` (`code`) USING BTREE,
INDEX `idx_data_news_item_status` (`status`) USING BTREE, INDEX `idx_data_news_item_status` (`status`) USING BTREE,
INDEX `idx_data_news_item_deleted` (`deleted`) USING BTREE INDEX `idx_data_news_item_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-内容' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-内容';
-- ---------------------------- -- ----------------------------
-- Table structure for data_news_mark -- Table structure for data_news_mark
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_news_mark`; DROP TABLE IF EXISTS `data_news_mark`;
CREATE TABLE `data_news_mark` ( CREATE TABLE `data_news_mark`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签名称', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签名称',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签说明', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签说明',
@ -212,32 +230,40 @@ CREATE TABLE `data_news_mark` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_mark_status` (`status`) USING BTREE, INDEX `idx_data_news_mark_status` (`status`) USING BTREE,
INDEX `idx_data_news_mark_deleted` (`deleted`) USING BTREE INDEX `idx_data_news_mark_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标签' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标签';
-- ---------------------------- -- ----------------------------
-- Table structure for data_news_x_collect -- Table structure for data_news_x_collect
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_news_x_collect`; DROP TABLE IF EXISTS `data_news_x_collect`;
CREATE TABLE `data_news_x_collect` ( CREATE TABLE `data_news_x_collect`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID',
`type` tinyint(1) NULL DEFAULT 1 COMMENT '记录类型(1收藏,2点赞,3历史,4评论)', `type` tinyint(1) NULL DEFAULT 1 COMMENT '记录类型(1收藏,2点赞,3历史,4评论)',
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章编号',
`reply` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '评论内容', `reply` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '评论内容',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '记录状态(0无效,1待审核,2已审核)', `status` tinyint(1) NULL DEFAULT 1 COMMENT '记录状态(0无效,1待审核,2已审核)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_news_x_collect_mid`(`uid`) USING BTREE, INDEX `idx_data_news_x_collect_uuid` (`uuid`) USING BTREE,
INDEX `idx_data_news_x_collect_type` (`type`) USING BTREE, INDEX `idx_data_news_x_collect_type` (`type`) USING BTREE,
INDEX `idx_data_news_x_collect_code` (`code`) USING BTREE, INDEX `idx_data_news_x_collect_code` (`code`) USING BTREE,
INDEX `idx_data_news_x_collect_status` (`status`) USING BTREE INDEX `idx_data_news_x_collect_status` (`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标记' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标记';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user -- Table structure for data_user
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user`; DROP TABLE IF EXISTS `data_user`;
CREATE TABLE `data_user` ( CREATE TABLE `data_user`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`pid0` bigint(20) NULL DEFAULT 0 COMMENT '临时推荐人UID', `pid0` bigint(20) NULL DEFAULT 0 COMMENT '临时推荐人UID',
`pid1` bigint(20) NULL DEFAULT 0 COMMENT '推荐人一级UID', `pid1` bigint(20) NULL DEFAULT 0 COMMENT '推荐人一级UID',
@ -293,15 +319,19 @@ CREATE TABLE `data_user` (
INDEX `idx_data_user_openid1` (`openid1`) USING BTREE, INDEX `idx_data_user_openid1` (`openid1`) USING BTREE,
INDEX `idx_data_user_openid2` (`openid2`) USING BTREE, INDEX `idx_data_user_openid2` (`openid2`) USING BTREE,
INDEX `idx_data_user_unionid` (`unionid`) USING BTREE INDEX `idx_data_user_unionid` (`unionid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-会员' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 2
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-会员';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_address -- Table structure for data_user_address
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user_address`; DROP TABLE IF EXISTS `data_user_address`;
CREATE TABLE `data_user_address` ( CREATE TABLE `data_user_address`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID', `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID',
`type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '地址类型(0普通,1默认)', `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '地址类型(0普通,1默认)',
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址编号',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '收货姓名', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '收货姓名',
@ -316,19 +346,23 @@ CREATE TABLE `data_user_address` (
`deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_user_address_uid`(`uid`) USING BTREE, INDEX `idx_data_user_address_uuid` (`uuid`) USING BTREE,
INDEX `idx_data_user_address_type` (`type`) USING BTREE, INDEX `idx_data_user_address_type` (`type`) USING BTREE,
INDEX `idx_data_user_address_code` (`code`) USING BTREE, INDEX `idx_data_user_address_code` (`code`) USING BTREE,
INDEX `idx_data_user_address_deleted` (`deleted`) USING BTREE INDEX `idx_data_user_address_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-地址' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-地址';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_balance -- Table structure for data_user_balance
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user_balance`; DROP TABLE IF EXISTS `data_user_balance`;
CREATE TABLE `data_user_balance` ( CREATE TABLE `data_user_balance`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID', `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID',
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值编号',
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值名称', `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值名称',
`remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值备注', `remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值备注',
@ -338,16 +372,20 @@ CREATE TABLE `data_user_balance` (
`create_by` bigint(20) NULL DEFAULT 0 COMMENT '系统用户', `create_by` bigint(20) NULL DEFAULT 0 COMMENT '系统用户',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_user_balance_uid`(`uid`) USING BTREE, INDEX `idx_data_user_balance_uuid` (`uuid`) USING BTREE,
INDEX `idx_data_user_balance_code` (`code`) USING BTREE, INDEX `idx_data_user_balance_code` (`code`) USING BTREE,
INDEX `idx_data_user_balance_deleted` (`deleted`) USING BTREE INDEX `idx_data_user_balance_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-余额' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-余额';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_message -- Table structure for data_user_message
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user_message`; DROP TABLE IF EXISTS `data_user_message`;
CREATE TABLE `data_user_message` ( CREATE TABLE `data_user_message`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '短信类型', `type` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '短信类型',
`msgid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号', `msgid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号',
@ -362,13 +400,17 @@ CREATE TABLE `data_user_message` (
INDEX `idx_data_user_message_phone` (`phone`) USING BTREE, INDEX `idx_data_user_message_phone` (`phone`) USING BTREE,
INDEX `idx_data_user_message_msgid` (`msgid`) USING BTREE, INDEX `idx_data_user_message_msgid` (`msgid`) USING BTREE,
INDEX `idx_data_user_message_status` (`status`) USING BTREE INDEX `idx_data_user_message_status` (`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-短信' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-短信';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_payment -- Table structure for data_user_payment
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user_payment`; DROP TABLE IF EXISTS `data_user_payment`;
CREATE TABLE `data_user_payment` ( CREATE TABLE `data_user_payment`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号',
`order_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单描述', `order_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单描述',
@ -386,42 +428,50 @@ CREATE TABLE `data_user_payment` (
INDEX `idx_data_user_payment_payment_type` (`payment_type`) USING BTREE, INDEX `idx_data_user_payment_payment_type` (`payment_type`) USING BTREE,
INDEX `idx_data_user_payment_payment_trade` (`payment_trade`) USING BTREE, INDEX `idx_data_user_payment_payment_trade` (`payment_trade`) USING BTREE,
INDEX `idx_data_user_payment_payment_status` (`payment_status`) USING BTREE INDEX `idx_data_user_payment_payment_status` (`payment_status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-支付' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-支付';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_rebate -- Table structure for data_user_rebate
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user_rebate`; DROP TABLE IF EXISTS `data_user_rebate`;
CREATE TABLE `data_user_rebate` ( CREATE TABLE `data_user_rebate`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID',
`date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励日期', `date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励日期',
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励编号',
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励类型', `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励类型',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励名称', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励名称',
`amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励数量', `amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励数量',
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号',
`order_uid` bigint(20) NULL DEFAULT 0 COMMENT '订单用户', `order_uuid` bigint(20) NULL DEFAULT 0 COMMENT '订单用户',
`order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额', `order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '生效状态(0未生效,1已生效)', `status` tinyint(1) NULL DEFAULT 1 COMMENT '生效状态(0未生效,1已生效)',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删除,1已删除)', `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删除,1已删除)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_user_rebate_uid`(`uid`) USING BTREE, INDEX `idx_data_user_rebate_uuid` (`uuid`) USING BTREE,
INDEX `idx_data_user_rebate_type` (`type`) USING BTREE, INDEX `idx_data_user_rebate_type` (`type`) USING BTREE,
INDEX `idx_data_user_rebate_date` (`date`) USING BTREE, INDEX `idx_data_user_rebate_date` (`date`) USING BTREE,
INDEX `idx_data_user_rebate_code` (`code`) USING BTREE, INDEX `idx_data_user_rebate_code` (`code`) USING BTREE,
INDEX `idx_data_user_rebate_name` (`name`) USING BTREE, INDEX `idx_data_user_rebate_name` (`name`) USING BTREE,
INDEX `idx_data_user_rebate_status` (`status`) USING BTREE INDEX `idx_data_user_rebate_status` (`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-返利' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-返利';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_token -- Table structure for data_user_token
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user_token`; DROP TABLE IF EXISTS `data_user_token`;
CREATE TABLE `data_user_token` ( CREATE TABLE `data_user_token`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID',
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权类型', `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权类型',
`time` bigint(20) NULL DEFAULT 0 COMMENT '有效时间', `time` bigint(20) NULL DEFAULT 0 COMMENT '有效时间',
`token` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权令牌', `token` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权令牌',
@ -431,15 +481,19 @@ CREATE TABLE `data_user_token` (
INDEX `idx_data_user_token_type` (`type`) USING BTREE, INDEX `idx_data_user_token_type` (`type`) USING BTREE,
INDEX `idx_data_user_token_time` (`time`) USING BTREE, INDEX `idx_data_user_token_time` (`time`) USING BTREE,
INDEX `idx_data_user_token_token` (`token`) USING BTREE INDEX `idx_data_user_token_token` (`token`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-认证' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-认证';
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_transfer -- Table structure for data_user_transfer
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `data_user_transfer`; DROP TABLE IF EXISTS `data_user_transfer`;
CREATE TABLE `data_user_transfer` ( CREATE TABLE `data_user_transfer`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID',
`type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现方式', `type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现方式',
`date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现日期', `date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现日期',
`code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现单号', `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现单号',
@ -467,7 +521,7 @@ CREATE TABLE `data_user_transfer` (
`status` tinyint(1) NULL DEFAULT 1 COMMENT '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)', `status` tinyint(1) NULL DEFAULT 1 COMMENT '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_user_transfer_uid`(`uid`) USING BTREE, INDEX `idx_data_user_transfer_uuid` (`uuid`) USING BTREE,
INDEX `idx_data_user_transfer_date` (`date`) USING BTREE, INDEX `idx_data_user_transfer_date` (`date`) USING BTREE,
INDEX `idx_data_user_transfer_type` (`type`) USING BTREE, INDEX `idx_data_user_transfer_type` (`type`) USING BTREE,
INDEX `idx_data_user_transfer_code` (`code`) USING BTREE, INDEX `idx_data_user_transfer_code` (`code`) USING BTREE,
@ -475,13 +529,17 @@ CREATE TABLE `data_user_transfer` (
INDEX `idx_data_user_transfer_appid` (`appid`) USING BTREE, INDEX `idx_data_user_transfer_appid` (`appid`) USING BTREE,
INDEX `idx_data_user_transfer_openid` (`openid`) USING BTREE, INDEX `idx_data_user_transfer_openid` (`openid`) USING BTREE,
INDEX `idx_data_user_transfer_audit_status` (`audit_status`) USING BTREE INDEX `idx_data_user_transfer_audit_status` (`audit_status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-提现' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-提现';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_goods -- Table structure for shop_goods
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_goods`; DROP TABLE IF EXISTS `shop_goods`;
CREATE TABLE `shop_goods` ( CREATE TABLE `shop_goods`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号',
`name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品名称', `name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品名称',
@ -516,16 +574,19 @@ CREATE TABLE `shop_goods` (
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_shop_goods_code` (`code`) USING BTREE, INDEX `idx_shop_goods_code` (`code`) USING BTREE,
INDEX `idx_shop_goods_cate`(`cateids`(191)) USING BTREE,
INDEX `idx_shop_goods_status` (`status`) USING BTREE, INDEX `idx_shop_goods_status` (`status`) USING BTREE,
INDEX `idx_shop_goods_deleted` (`deleted`) USING BTREE INDEX `idx_shop_goods_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-内容' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-内容';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_goods_cate -- Table structure for shop_goods_cate
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_goods_cate`; DROP TABLE IF EXISTS `shop_goods_cate`;
CREATE TABLE `shop_goods_cate` ( CREATE TABLE `shop_goods_cate`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`pid` bigint(20) NULL DEFAULT 0 COMMENT '上级分类', `pid` bigint(20) NULL DEFAULT 0 COMMENT '上级分类',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '分类名称', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '分类名称',
@ -539,13 +600,17 @@ CREATE TABLE `shop_goods_cate` (
INDEX `idx_shop_goods_cate_sort` (`sort`) USING BTREE, INDEX `idx_shop_goods_cate_sort` (`sort`) USING BTREE,
INDEX `idx_shop_goods_cate_status` (`status`) USING BTREE, INDEX `idx_shop_goods_cate_status` (`status`) USING BTREE,
INDEX `idx_shop_goods_cate_deleted` (`deleted`) USING BTREE INDEX `idx_shop_goods_cate_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-分类' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-分类';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_goods_item -- Table structure for shop_goods_item
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_goods_item`; DROP TABLE IF EXISTS `shop_goods_item`;
CREATE TABLE `shop_goods_item` ( CREATE TABLE `shop_goods_item`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品SKU', `goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品SKU',
`goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号',
@ -564,13 +629,17 @@ CREATE TABLE `shop_goods_item` (
INDEX `index_store_goods_item_code` (`goods_code`) USING BTREE, INDEX `index_store_goods_item_code` (`goods_code`) USING BTREE,
INDEX `index_store_goods_item_spec` (`goods_spec`) USING BTREE, INDEX `index_store_goods_item_spec` (`goods_spec`) USING BTREE,
INDEX `index_store_goods_item_status` (`status`) USING BTREE INDEX `index_store_goods_item_status` (`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-规格' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-规格';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_goods_mark -- Table structure for shop_goods_mark
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_goods_mark`; DROP TABLE IF EXISTS `shop_goods_mark`;
CREATE TABLE `shop_goods_mark` ( CREATE TABLE `shop_goods_mark`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签名称', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签名称',
`remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签描述', `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签描述',
@ -580,13 +649,17 @@ CREATE TABLE `shop_goods_mark` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_shop_goods_mark_sort` (`sort`) USING BTREE, INDEX `idx_shop_goods_mark_sort` (`sort`) USING BTREE,
INDEX `idx_shop_goods_mark_status` (`status`) USING BTREE INDEX `idx_shop_goods_mark_status` (`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-标签' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-标签';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_goods_stock -- Table structure for shop_goods_stock
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_goods_stock`; DROP TABLE IF EXISTS `shop_goods_stock`;
CREATE TABLE `shop_goods_stock` ( CREATE TABLE `shop_goods_stock`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`batch_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '操作批量', `batch_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '操作批量',
`goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号',
@ -598,15 +671,19 @@ CREATE TABLE `shop_goods_stock` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_shop_goods_stock_status` (`status`) USING BTREE, INDEX `idx_shop_goods_stock_status` (`status`) USING BTREE,
INDEX `idx_shop_goods_stock_deleted` (`deleted`) USING BTREE INDEX `idx_shop_goods_stock_deleted` (`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-库存' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-库存';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_order -- Table structure for shop_order
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_order`; DROP TABLE IF EXISTS `shop_order`;
CREATE TABLE `shop_order` ( CREATE TABLE `shop_order`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '下单用户编号', `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '下单用户编号',
`puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐一层用户', `puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐一层用户',
`puid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐二层用户', `puid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐二层用户',
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品订单单号', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品订单单号',
@ -641,22 +718,26 @@ CREATE TABLE `shop_order` (
`status` tinyint(1) NULL DEFAULT 1 COMMENT '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)', `status` tinyint(1) NULL DEFAULT 1 COMMENT '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_shop_order_mid`(`uid`) USING BTREE, INDEX `idx_shop_order_mid` (`uuid`) USING BTREE,
INDEX `idx_shop_order_from` (`puid1`) USING BTREE, INDEX `idx_shop_order_from` (`puid1`) USING BTREE,
INDEX `idx_shop_order_status` (`status`) USING BTREE, INDEX `idx_shop_order_status` (`status`) USING BTREE,
INDEX `idx_shop_order_deleted` (`deleted_status`) USING BTREE, INDEX `idx_shop_order_deleted` (`deleted_status`) USING BTREE,
INDEX `idx_shop_order_orderno` (`order_no`) USING BTREE, INDEX `idx_shop_order_orderno` (`order_no`) USING BTREE,
INDEX `idx_shop_order_cancel_status` (`cancel_status`) USING BTREE, INDEX `idx_shop_order_cancel_status` (`cancel_status`) USING BTREE,
INDEX `idx_shop_order_payment_status` (`payment_status`) USING BTREE INDEX `idx_shop_order_payment_status` (`payment_status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-内容' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-内容';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_order_item -- Table structure for shop_order_item
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_order_item`; DROP TABLE IF EXISTS `shop_order_item`;
CREATE TABLE `shop_order_item` ( CREATE TABLE `shop_order_item`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号', `uuid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号',
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号',
`goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品SKU', `goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品SKU',
`goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品编号', `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品编号',
@ -694,15 +775,19 @@ CREATE TABLE `shop_order_item` (
INDEX `idx_shop_order_item_goods_code` (`goods_code`) USING BTREE, INDEX `idx_shop_order_item_goods_code` (`goods_code`) USING BTREE,
INDEX `idx_shop_order_item_goods_spec` (`goods_spec`) USING BTREE, INDEX `idx_shop_order_item_goods_spec` (`goods_spec`) USING BTREE,
INDEX `idx_shop_order_item_rebate_type` (`rebate_type`) USING BTREE INDEX `idx_shop_order_item_rebate_type` (`rebate_type`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-商品' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-商品';
-- ---------------------------- -- ----------------------------
-- Table structure for shop_order_send -- Table structure for shop_order_send
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `shop_order_send`; DROP TABLE IF EXISTS `shop_order_send`;
CREATE TABLE `shop_order_send` ( CREATE TABLE `shop_order_send`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`uid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号', `uuid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号',
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号',
`address_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址编号', `address_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址编号',
`address_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人姓名', `address_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人姓名',
@ -728,17 +813,21 @@ CREATE TABLE `shop_order_send` (
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '发货删除状态(0未删,1已删)', `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '发货删除状态(0未删,1已删)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_shop_order_send_mid`(`uid`) USING BTREE, INDEX `idx_shop_order_send_mid` (`uuid`) USING BTREE,
INDEX `idx_shop_order_send_status` (`status`) USING BTREE, INDEX `idx_shop_order_send_status` (`status`) USING BTREE,
INDEX `idx_shop_order_send_deleted` (`deleted`) USING BTREE, INDEX `idx_shop_order_send_deleted` (`deleted`) USING BTREE,
INDEX `idx_shop_order_send_order_no` (`order_no`) USING BTREE INDEX `idx_shop_order_send_order_no` (`order_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-配送' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-配送';
-- ---------------------------- -- ----------------------------
-- Table structure for system_auth -- Table structure for system_auth
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_auth`; DROP TABLE IF EXISTS `system_auth`;
CREATE TABLE `system_auth` ( CREATE TABLE `system_auth`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '权限名称', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '权限名称',
`desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注说明', `desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注说明',
@ -748,26 +837,34 @@ CREATE TABLE `system_auth` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_auth_title` (`title`) USING BTREE, INDEX `idx_system_auth_title` (`title`) USING BTREE,
INDEX `idx_system_auth_status` (`status`) USING BTREE INDEX `idx_system_auth_status` (`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-权限' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-权限';
-- ---------------------------- -- ----------------------------
-- Table structure for system_auth_node -- Table structure for system_auth_node
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_auth_node`; DROP TABLE IF EXISTS `system_auth_node`;
CREATE TABLE `system_auth_node` ( CREATE TABLE `system_auth_node`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`auth` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '角色', `auth` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '角色',
`node` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '节点', `node` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '节点',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_auth_auth` (`auth`) USING BTREE, INDEX `idx_system_auth_auth` (`auth`) USING BTREE,
INDEX `idx_system_auth_node` (`node`(191)) USING BTREE INDEX `idx_system_auth_node` (`node`(191)) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-授权' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-授权';
-- ---------------------------- -- ----------------------------
-- Table structure for system_config -- Table structure for system_config
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_config`; DROP TABLE IF EXISTS `system_config`;
CREATE TABLE `system_config` ( CREATE TABLE `system_config`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置分类', `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置分类',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置名称', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置名称',
@ -775,25 +872,33 @@ CREATE TABLE `system_config` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_config_type` (`type`) USING BTREE, INDEX `idx_system_config_type` (`type`) USING BTREE,
INDEX `idx_system_config_name` (`name`) USING BTREE INDEX `idx_system_config_name` (`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-配置' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-配置';
-- ---------------------------- -- ----------------------------
-- Table structure for system_data -- Table structure for system_data
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_data`; DROP TABLE IF EXISTS `system_data`;
CREATE TABLE `system_data` ( CREATE TABLE `system_data`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置名', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置名',
`value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '配置值', `value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '配置值',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_data_name` (`name`) USING BTREE INDEX `idx_system_data_name` (`name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-数据' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-数据';
-- ---------------------------- -- ----------------------------
-- Table structure for system_menu -- Table structure for system_menu
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_menu`; DROP TABLE IF EXISTS `system_menu`;
CREATE TABLE `system_menu` ( CREATE TABLE `system_menu`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`pid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '上级ID', `pid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '上级ID',
`title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '菜单名称', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '菜单名称',
@ -807,13 +912,17 @@ CREATE TABLE `system_menu` (
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_system_menu_status` (`status`) USING BTREE INDEX `idx_system_menu_status` (`status`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-菜单' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-菜单';
-- ---------------------------- -- ----------------------------
-- Table structure for system_oplog -- Table structure for system_oplog
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_oplog`; DROP TABLE IF EXISTS `system_oplog`;
CREATE TABLE `system_oplog` ( CREATE TABLE `system_oplog`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`node` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '当前操作节点', `node` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '当前操作节点',
`geoip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '操作者IP地址', `geoip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '操作者IP地址',
@ -822,13 +931,17 @@ CREATE TABLE `system_oplog` (
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '操作人用户名', `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '操作人用户名',
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 79 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-日志' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-日志';
-- ---------------------------- -- ----------------------------
-- Table structure for system_queue -- Table structure for system_queue
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_queue`; DROP TABLE IF EXISTS `system_queue`;
CREATE TABLE `system_queue` ( CREATE TABLE `system_queue`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务编号', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务编号',
`title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务名称', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务名称',
@ -851,13 +964,17 @@ CREATE TABLE `system_queue` (
INDEX `idx_system_queue_rscript` (`rscript`) USING BTREE, INDEX `idx_system_queue_rscript` (`rscript`) USING BTREE,
INDEX `idx_system_queue_create_at` (`create_at`) USING BTREE, INDEX `idx_system_queue_create_at` (`create_at`) USING BTREE,
INDEX `idx_system_queue_exec_time` (`exec_time`) USING BTREE INDEX `idx_system_queue_exec_time` (`exec_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-任务' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-任务';
-- ---------------------------- -- ----------------------------
-- Table structure for system_user -- Table structure for system_user
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `system_user`; DROP TABLE IF EXISTS `system_user`;
CREATE TABLE `system_user` ( CREATE TABLE `system_user`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户账号', `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户账号',
`password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户密码', `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户密码',
@ -879,13 +996,17 @@ CREATE TABLE `system_user` (
INDEX `idx_system_user_status` (`status`) USING BTREE, INDEX `idx_system_user_status` (`status`) USING BTREE,
INDEX `idx_system_user_username` (`username`) USING BTREE, INDEX `idx_system_user_username` (`username`) USING BTREE,
INDEX `idx_system_user_deleted` (`is_deleted`) USING BTREE INDEX `idx_system_user_deleted` (`is_deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10001 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-用户' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 10001
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '系统-用户';
-- ---------------------------- -- ----------------------------
-- Table structure for wechat_auto -- Table structure for wechat_auto
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `wechat_auto`; DROP TABLE IF EXISTS `wechat_auto`;
CREATE TABLE `wechat_auto` ( CREATE TABLE `wechat_auto`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)',
`time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '延迟时间', `time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '延迟时间',
@ -908,15 +1029,19 @@ CREATE TABLE `wechat_auto` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_wechat_auto_type` (`type`) USING BTREE, INDEX `idx_wechat_auto_type` (`type`) USING BTREE,
INDEX `idx_wechat_auto_keys` (`time`) USING BTREE, INDEX `idx_wechat_auto_keys` (`time`) USING BTREE,
INDEX `idx_wechat_auto_appid`(`appid`) USING BTREE, INDEX `idx_wechat_auto_code` (`code`) USING BTREE,
INDEX `idx_wechat_auto_code`(`code`) USING BTREE INDEX `idx_wechat_auto_appid` (`appid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-回复' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '微信-回复';
-- ---------------------------- -- ----------------------------
-- Table structure for wechat_fans -- Table structure for wechat_fans
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `wechat_fans`; DROP TABLE IF EXISTS `wechat_fans`;
CREATE TABLE `wechat_fans` ( CREATE TABLE `wechat_fans`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`appid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', `appid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID',
`unionid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '粉丝unionid', `unionid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '粉丝unionid',
@ -943,13 +1068,17 @@ CREATE TABLE `wechat_fans` (
INDEX `index_wechat_fans_unionid` (`unionid`) USING BTREE, INDEX `index_wechat_fans_unionid` (`unionid`) USING BTREE,
INDEX `index_wechat_fans_isblack` (`is_black`) USING BTREE, INDEX `index_wechat_fans_isblack` (`is_black`) USING BTREE,
INDEX `index_wechat_fans_subscribe` (`subscribe`) USING BTREE INDEX `index_wechat_fans_subscribe` (`subscribe`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-粉丝' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '微信-粉丝';
-- ---------------------------- -- ----------------------------
-- Table structure for wechat_fans_tags -- Table structure for wechat_fans_tags
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `wechat_fans_tags`; DROP TABLE IF EXISTS `wechat_fans_tags`;
CREATE TABLE `wechat_fans_tags` ( CREATE TABLE `wechat_fans_tags`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '标签ID', `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '标签ID',
`appid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', `appid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID',
`name` varchar(35) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标签名称', `name` varchar(35) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标签名称',
@ -957,13 +1086,17 @@ CREATE TABLE `wechat_fans_tags` (
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
INDEX `index_wechat_fans_tags_id` (`id`) USING BTREE, INDEX `index_wechat_fans_tags_id` (`id`) USING BTREE,
INDEX `index_wechat_fans_tags_appid` (`appid`) USING BTREE INDEX `index_wechat_fans_tags_appid` (`appid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-标签' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '微信-标签';
-- ---------------------------- -- ----------------------------
-- Table structure for wechat_keys -- Table structure for wechat_keys
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `wechat_keys`; DROP TABLE IF EXISTS `wechat_keys`;
CREATE TABLE `wechat_keys` ( CREATE TABLE `wechat_keys`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', `appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID',
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)',
@ -987,13 +1120,17 @@ CREATE TABLE `wechat_keys` (
INDEX `index_wechat_keys_type` (`type`) USING BTREE, INDEX `index_wechat_keys_type` (`type`) USING BTREE,
INDEX `index_wechat_keys_keys` (`keys`) USING BTREE, INDEX `index_wechat_keys_keys` (`keys`) USING BTREE,
INDEX `index_wechat_keys_appid` (`appid`) USING BTREE INDEX `index_wechat_keys_appid` (`appid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-规则' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 2
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '微信-规则';
-- ---------------------------- -- ----------------------------
-- Table structure for wechat_media -- Table structure for wechat_media
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `wechat_media`; DROP TABLE IF EXISTS `wechat_media`;
CREATE TABLE `wechat_media` ( CREATE TABLE `wechat_media`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文件md5', `md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文件md5',
`type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '媒体类型', `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '媒体类型',
@ -1007,13 +1144,17 @@ CREATE TABLE `wechat_media` (
INDEX `index_wechat_media_type` (`type`) USING BTREE, INDEX `index_wechat_media_type` (`type`) USING BTREE,
INDEX `index_wechat_media_appid` (`appid`) USING BTREE, INDEX `index_wechat_media_appid` (`appid`) USING BTREE,
INDEX `index_wechat_media_media_id` (`media_id`) USING BTREE INDEX `index_wechat_media_media_id` (`media_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-素材' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '微信-素材';
-- ---------------------------- -- ----------------------------
-- Table structure for wechat_news -- Table structure for wechat_news
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `wechat_news`; DROP TABLE IF EXISTS `wechat_news`;
CREATE TABLE `wechat_news` ( CREATE TABLE `wechat_news`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`media_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材MediaID', `media_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材MediaID',
`local_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材外网URL', `local_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材外网URL',
@ -1024,13 +1165,17 @@ CREATE TABLE `wechat_news` (
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `index_wechat_news_media_id` (`media_id`) USING BTREE, INDEX `index_wechat_news_media_id` (`media_id`) USING BTREE,
INDEX `index_wechat_news_artcle_id` (`article_id`) USING BTREE INDEX `index_wechat_news_artcle_id` (`article_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-图文' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '微信-图文';
-- ---------------------------- -- ----------------------------
-- Table structure for wechat_news_article -- Table structure for wechat_news_article
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `wechat_news_article`; DROP TABLE IF EXISTS `wechat_news_article`;
CREATE TABLE `wechat_news_article` ( CREATE TABLE `wechat_news_article`
(
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '素材标题', `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '素材标题',
`local_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材显示URL', `local_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材显示URL',
@ -1042,6 +1187,10 @@ CREATE TABLE `wechat_news_article` (
`read_num` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '阅读数量', `read_num` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '阅读数量',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-文章' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '微信-文章';
SET FOREIGN_KEY_CHECKS = 1; SET
FOREIGN_KEY_CHECKS = 1;

File diff suppressed because it is too large Load Diff

View File

@ -18,9 +18,9 @@ class UserAgent extends Command
protected function configure() protected function configure()
{ {
$this->setName('xdata:UserAgent'); $this->setName('xdata:UserAgent');
$this->addArgument('uid', Argument::OPTIONAL, '目标用户', ''); $this->addArgument('uuid', Argument::OPTIONAL, '目标用户', '');
$this->addArgument('pid', Argument::OPTIONAL, '上级代理', ''); $this->addArgument('puid', Argument::OPTIONAL, '上级代理', '');
$this->setDescription('重新设置用户上级代理, 参数:UID PID'); $this->setDescription('重新设置用户上级代理, 参数:uuid puid');
} }
/** /**
@ -34,12 +34,12 @@ class UserAgent extends Command
*/ */
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
[$uid, $pid] = [$input->getArgument('uid'), $input->getArgument('pid')]; [$uuid, $pid] = [$input->getArgument('uuid'), $input->getArgument('pid')];
if (empty($uid)) $this->setQueueError("参数UID无效请传入正确的参数!"); if (empty($uuid)) $this->setQueueError("参数UID无效请传入正确的参数!");
if (empty($pid)) $this->setQueueError("参数PID无效请传入正确的参数!"); if (empty($pid)) $this->setQueueError("参数PID无效请传入正确的参数!");
// 检查当前用户资料 // 检查当前用户资料
$user = $this->app->db->name('DataUser')->where(['id' => $uid])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $uuid])->find();
if (empty($user)) $this->setQueueError("读取用户数据失败!"); if (empty($user)) $this->setQueueError("读取用户数据失败!");
// 检查上级代理用户 // 检查上级代理用户

View File

@ -98,7 +98,7 @@ class UserTransfer extends Command
*/ */
private function createTransferBank(array $item): array private function createTransferBank(array $item): array
{ {
$config = $this->getConfig($item['uid']); $config = $this->getConfig($item['uuid']);
return [$config, TransfersBank::instance($config)->create([ return [$config, TransfersBank::instance($config)->create([
'partner_trade_no' => $item['code'], 'partner_trade_no' => $item['code'],
'enc_bank_no' => $item['bank_code'], 'enc_bank_no' => $item['bank_code'],
@ -111,14 +111,14 @@ class UserTransfer extends Command
/** /**
* 获取微信提现参数 * 获取微信提现参数
* @param int $uid * @param int $uuid
* @return array * @return array
* @throws Exception * @throws Exception
* @throws DataNotFoundException * @throws DataNotFoundException
* @throws DbException * @throws DbException
* @throws ModelNotFoundException * @throws ModelNotFoundException
*/ */
private function getConfig(int $uid): array private function getConfig(int $uuid): array
{ {
$data = sysdata('TransferWxpay'); $data = sysdata('TransferWxpay');
if (empty($data)) throw new Exception('未配置微信提现商户'); if (empty($data)) throw new Exception('未配置微信提现商户');
@ -131,7 +131,7 @@ class UserTransfer extends Command
$local->set($file2, $data['wechat_mch_cert_text'], true); $local->set($file2, $data['wechat_mch_cert_text'], true);
} }
// 获取用户支付信息 // 获取用户支付信息
$result = $this->getWechatInfo($uid, $data['wechat_type']); $result = $this->getWechatInfo($uuid, $data['wechat_type']);
if (empty($result)) throw new Exception('无法读取打款数据'); if (empty($result)) throw new Exception('无法读取打款数据');
return [ return [
'appid' => $result[0], 'appid' => $result[0],
@ -146,16 +146,16 @@ class UserTransfer extends Command
/** /**
* 根据配置获取用户OPENID * 根据配置获取用户OPENID
* @param int $uid * @param int $uuid
* @param string $type * @param string $type
* @return mixed|null * @return mixed|null
* @throws DataNotFoundException * @throws DataNotFoundException
* @throws DbException * @throws DbException
* @throws ModelNotFoundException * @throws ModelNotFoundException
*/ */
private function getWechatInfo(int $uid, string $type): ?array private function getWechatInfo(int $uuid, string $type): ?array
{ {
$user = $this->app->db->name('DataUser')->where(['id' => $uid])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $uuid])->find();
if (empty($user)) return null; if (empty($user)) return null;
$appid1 = sysconf('data.wxapp_appid'); $appid1 = sysconf('data.wxapp_appid');
if (strtolower(sysconf('wechat.type')) === 'api') { if (strtolower(sysconf('wechat.type')) === 'api') {
@ -189,7 +189,7 @@ class UserTransfer extends Command
*/ */
private function createTransferWallet(array $item): array private function createTransferWallet(array $item): array
{ {
$config = $this->getConfig($item['uid']); $config = $this->getConfig($item['uuid']);
return [$config, Transfers::instance($config)->create([ return [$config, Transfers::instance($config)->create([
'openid' => $config['openid'], 'openid' => $config['openid'],
'amount' => intval($item['amount'] - $item['charge_amount']) * 100, 'amount' => intval($item['amount'] - $item['charge_amount']) * 100,
@ -212,7 +212,7 @@ class UserTransfer extends Command
*/ */
private function queryTransferBank(array $item) private function queryTransferBank(array $item)
{ {
$config = $this->getConfig($item['uid']); $config = $this->getConfig($item['uuid']);
[$config['appid'], $config['openid']] = [$item['appid'], $item['openid']]; [$config['appid'], $config['openid']] = [$item['appid'], $item['openid']];
$result = TransfersBank::instance($config)->query($item['trade_no']); $result = TransfersBank::instance($config)->query($item['trade_no']);
if ($result['return_code'] === 'SUCCESS' && $result['result_code'] === 'SUCCESS') { if ($result['return_code'] === 'SUCCESS' && $result['result_code'] === 'SUCCESS') {
@ -233,7 +233,7 @@ class UserTransfer extends Command
'change_desc' => '微信提现打款失败', 'change_desc' => '微信提现打款失败',
]); ]);
// 刷新用户可提现余额 // 刷新用户可提现余额
UserRebateService::instance()->amount($item['uid']); UserRebateService::instance()->amount($item['uuid']);
} }
} }
} }
@ -250,7 +250,7 @@ class UserTransfer extends Command
*/ */
private function queryTransferWallet(array $item) private function queryTransferWallet(array $item)
{ {
$config = $this->getConfig($item['uid']); $config = $this->getConfig($item['uuid']);
[$config['appid'], $config['openid']] = [$item['appid'], $item['openid']]; [$config['appid'], $config['openid']] = [$item['appid'], $item['openid']];
$result = Transfers::instance($config)->query($item['trade_no']); $result = Transfers::instance($config)->query($item['trade_no']);
if ($result['return_code'] === 'SUCCESS' && $result['result_code'] === 'SUCCESS') { if ($result['return_code'] === 'SUCCESS' && $result['result_code'] === 'SUCCESS') {

View File

@ -35,8 +35,8 @@ class News extends Controller
{ {
if ($code = input('code', '')) { if ($code = input('code', '')) {
$this->app->db->name('DataNewsItem')->where(['code' => $code])->inc('num_read')->update(); $this->app->db->name('DataNewsItem')->where(['code' => $code])->inc('num_read')->update();
if (($uid = input('uid', 0)) > 0) { if (($uuid = input('uuid', 0)) > 0) {
$data = ['uid' => $uid, 'code' => $code, 'type' => 3, 'status' => 2]; $data = ['uuid' => $uuid, 'code' => $code, 'type' => 3, 'status' => 2];
$this->app->db->name('DataNewsXCollect')->where($data)->delete(); $this->app->db->name('DataNewsXCollect')->where($data)->delete();
$this->app->db->name('DataNewsXCollect')->insert($data); $this->app->db->name('DataNewsXCollect')->insert($data);
} }
@ -44,7 +44,7 @@ class News extends Controller
$query = $this->_query('DataNewsItem')->like('name,mark')->equal('id,code'); $query = $this->_query('DataNewsItem')->like('name,mark')->equal('id,code');
$query->where(['deleted' => 0, 'status' => 1])->withoutField('sort,status,deleted'); $query->where(['deleted' => 0, 'status' => 1])->withoutField('sort,status,deleted');
$result = $query->order('sort desc,id desc')->page(true, false, false, 15); $result = $query->order('sort desc,id desc')->page(true, false, false, 15);
NewsService::instance()->buildData($result['list'], input('uid', 0)); NewsService::instance()->buildData($result['list'], input('uuid', 0));
$this->success('获取文章内容', $result); $this->success('获取文章内容', $result);
} }

View File

@ -25,7 +25,7 @@ class Address extends Auth
public function set() public function set()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.default' => 0, 'type.default' => 0,
'code.default' => '', 'code.default' => '',
'idcode.default' => '', // 身份证号码 'idcode.default' => '', // 身份证号码
@ -50,14 +50,14 @@ class Address extends Auth
$this->error('添加地址失败!'); $this->error('添加地址失败!');
} }
} else { } else {
$map = ['uid' => $this->uuid, 'code' => $data['code']]; $map = ['uuid' => $this->uuid, 'code' => $data['code']];
$address = $this->app->db->name($this->table)->where($map)->find(); $address = $this->app->db->name($this->table)->where($map)->find();
if (empty($address)) $this->error('修改地址不存在!'); if (empty($address)) $this->error('修改地址不存在!');
$this->app->db->name($this->table)->where($map)->update($data); $this->app->db->name($this->table)->where($map)->update($data);
} }
// 去除其它默认选项 // 去除其它默认选项
if (isset($data['type']) && $data['type'] > 0) { if (isset($data['type']) && $data['type'] > 0) {
$map = [['uid', '=', $this->uuid], ['code', '<>', $data['code']]]; $map = [['uuid', '=', $this->uuid], ['code', '<>', $data['code']]];
$this->app->db->name($this->table)->where($map)->update(['type' => 0]); $this->app->db->name($this->table)->where($map)->update(['type' => 0]);
} }
$this->success('地址保存成功!', $this->_getAddress($data['code'])); $this->success('地址保存成功!', $this->_getAddress($data['code']));
@ -72,7 +72,7 @@ class Address extends Auth
public function get() public function get()
{ {
$query = $this->_query($this->table)->withoutField('deleted'); $query = $this->_query($this->table)->withoutField('deleted');
$query->equal('code')->where(['uid' => $this->uuid, 'deleted' => 0]); $query->equal('code')->where(['uuid' => $this->uuid, 'deleted' => 0]);
$result = $query->order('type desc,id desc')->page(false, false, false, 15); $result = $query->order('type desc,id desc')->page(false, false, false, 15);
$this->success('获取地址数据!', $result); $this->success('获取地址数据!', $result);
} }
@ -84,13 +84,13 @@ class Address extends Auth
public function state() public function state()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.in:0,1' => '地址状态不在范围!', 'type.in:0,1' => '地址状态不在范围!',
'type.require' => '地址状态不能为空!', 'type.require' => '地址状态不能为空!',
'code.require' => '地址编号不能为空!', 'code.require' => '地址编号不能为空!',
]); ]);
// 检查地址是否存在 // 检查地址是否存在
$map = ['uid' => $data['uid'], 'code' => $data['code']]; $map = ['uuid' => $data['uuid'], 'code' => $data['code']];
if ($this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->app->db->name($this->table)->where($map)->count() < 1) {
$this->error('修改的地址不存在!'); $this->error('修改的地址不存在!');
} }
@ -99,7 +99,7 @@ class Address extends Auth
$this->app->db->name($this->table)->where($map)->update(['type' => $data['type']]); $this->app->db->name($this->table)->where($map)->update(['type' => $data['type']]);
// 去除其它默认选项 // 去除其它默认选项
if ($data['type'] > 0) { if ($data['type'] > 0) {
$map = [['uid', '=', $this->uuid], ['code', '<>', $data['code']]]; $map = [['uuid', '=', $this->uuid], ['code', '<>', $data['code']]];
$this->app->db->name($this->table)->where($map)->update(['type' => 0]); $this->app->db->name($this->table)->where($map)->update(['type' => 0]);
} }
$this->success('默认设置成功!', $this->_getAddress($data['code'])); $this->success('默认设置成功!', $this->_getAddress($data['code']));
@ -112,7 +112,7 @@ class Address extends Auth
public function remove() public function remove()
{ {
$map = $this->_vali([ $map = $this->_vali([
'uid.value' => $this->uuid, 'code.require' => '地址编号不能为空!', 'uuid.value' => $this->uuid, 'code.require' => '地址编号不能为空!',
]); ]);
$address = $this->app->db->name($this->table)->where($map)->find(); $address = $this->app->db->name($this->table)->where($map)->find();
if (empty($address)) $this->error('需要删除的地址不存在!'); if (empty($address)) $this->error('需要删除的地址不存在!');
@ -133,7 +133,7 @@ class Address extends Auth
*/ */
private function _getAddress(string $code): ?array private function _getAddress(string $code): ?array
{ {
$map = ['code' => $code, 'uid' => $this->uuid, 'deleted' => 0]; $map = ['code' => $code, 'uuid' => $this->uuid, 'deleted' => 0];
return $this->app->db->name($this->table)->withoutField('deleted')->where($map)->find(); return $this->app->db->name($this->table)->withoutField('deleted')->where($map)->find();
} }

View File

@ -26,7 +26,7 @@ class Balance extends Auth
public function get() public function get()
{ {
$query = $this->_query($this->table); $query = $this->_query($this->table);
$query->withoutField('deleted,create_by')->where(['uid' => $this->uuid, 'deleted' => 0]); $query->withoutField('deleted,create_by')->where(['uuid' => $this->uuid, 'deleted' => 0]);
$result = $query->like('create_at#date')->order('id desc')->page(true, false, false, 10); $result = $query->like('create_at#date')->order('id desc')->page(true, false, false, 10);
$this->success('获取数据成功', $result); $this->success('获取数据成功', $result);
} }

View File

@ -126,7 +126,7 @@ class Center extends Auth
$map[] = ['path', 'like', "%-{$this->uuid}-%"]; $map[] = ['path', 'like', "%-{$this->uuid}-%"];
// 查询邀请的朋友 // 查询邀请的朋友
$query = $this->_query($this->table); $query = $this->_query($this->table);
$query->like('nickname|username#nickname')->equal('vip_code,pids,pid1,id#uid'); $query->like('nickname|username#nickname')->equal('vip_code,pids,pid1,id#uuid');
$query->field('id,pid0,pid1,pid2,pids,username,nickname,headimg,order_amount_total,teams_amount_total,teams_amount_direct,teams_amount_indirect,teams_users_total,teams_users_direct,teams_users_indirect,rebate_total,rebate_used,rebate_lock,create_at'); $query->field('id,pid0,pid1,pid2,pids,username,nickname,headimg,order_amount_total,teams_amount_total,teams_amount_direct,teams_amount_indirect,teams_users_total,teams_users_direct,teams_users_indirect,rebate_total,rebate_used,rebate_lock,create_at');
$result = $query->where($map)->order('id desc')->page(true, false, false, 15); $result = $query->where($map)->order('id desc')->page(true, false, false, 15);
// 统计当前用户所有下属数 // 统计当前用户所有下属数

View File

@ -25,7 +25,7 @@ class News extends Auth
public function addComment() public function addComment()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.value' => 4, 'type.value' => 4,
'status.value' => 1, 'status.value' => 1,
'code.require' => '文章不能为空!', 'code.require' => '文章不能为空!',
@ -47,7 +47,7 @@ class News extends Auth
*/ */
public function getComment() public function getComment()
{ {
$query = $this->_query($this->table)->where(['uid' => $this->uuid, 'type' => 4]); $query = $this->_query($this->table)->where(['uuid' => $this->uuid, 'type' => 4]);
$result = $query->whereIn('status', [1, 2])->order('id desc')->page(true, false, false, 15); $result = $query->whereIn('status', [1, 2])->order('id desc')->page(true, false, false, 15);
NewsService::instance()->buildListByUidAndCode($result); NewsService::instance()->buildListByUidAndCode($result);
$this->success('获取评论列表成功', $result); $this->success('获取评论列表成功', $result);
@ -60,7 +60,7 @@ class News extends Auth
public function delComment() public function delComment()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.value' => 4, 'type.value' => 4,
'id.require' => '评论编号不能为空!', 'id.require' => '评论编号不能为空!',
'code.require' => '文章编号不能为空!', 'code.require' => '文章编号不能为空!',
@ -79,7 +79,7 @@ class News extends Auth
public function addCollect() public function addCollect()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.value' => 1, 'type.value' => 1,
'status.value' => 2, 'status.value' => 2,
'code.require' => '文章编号不能为空!', 'code.require' => '文章编号不能为空!',
@ -102,7 +102,7 @@ class News extends Auth
public function delCollect() public function delCollect()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.value' => 1, 'type.value' => 1,
'code.require' => '文章编号不能为空!', 'code.require' => '文章编号不能为空!',
]); ]);
@ -120,7 +120,7 @@ class News extends Auth
*/ */
public function getCollect() public function getCollect()
{ {
$map = ['uid' => $this->uuid, 'type' => 1]; $map = ['uuid' => $this->uuid, 'type' => 1];
$query = $this->_query('DataNewsXCollect')->where($map); $query = $this->_query('DataNewsXCollect')->where($map);
$result = $query->order('id desc')->page(true, false, false, 15); $result = $query->order('id desc')->page(true, false, false, 15);
NewsService::instance()->buildListByUidAndCode($result['list']); NewsService::instance()->buildListByUidAndCode($result['list']);
@ -134,7 +134,7 @@ class News extends Auth
public function addLike() public function addLike()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.value' => 2, 'type.value' => 2,
'status.value' => 2, 'status.value' => 2,
'code.require' => '文章编号不能为空!', 'code.require' => '文章编号不能为空!',
@ -157,7 +157,7 @@ class News extends Auth
public function delLike() public function delLike()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.value' => 2, 'type.value' => 2,
'code.require' => '文章编号不能为空!', 'code.require' => '文章编号不能为空!',
]); ]);
@ -176,7 +176,7 @@ class News extends Auth
public function getLike() public function getLike()
{ {
$query = $this->_query('DataNewsXCollect'); $query = $this->_query('DataNewsXCollect');
$query->where(['uid' => $this->uuid, 'type' => 2, 'status' => 2]); $query->where(['uuid' => $this->uuid, 'type' => 2, 'status' => 2]);
$result = $query->order('id desc')->page(true, false, false, 15); $result = $query->order('id desc')->page(true, false, false, 15);
NewsService::instance()->buildListByUidAndCode($result['list']); NewsService::instance()->buildListByUidAndCode($result['list']);
$this->success('获取点赞记录成功!', $result); $this->success('获取点赞记录成功!', $result);
@ -189,7 +189,7 @@ class News extends Auth
public function addHistory() public function addHistory()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'type.value' => 2, 'type.value' => 2,
'status.value' => 2, 'status.value' => 2,
'code.require' => '文章编号不能为空!', 'code.require' => '文章编号不能为空!',
@ -208,7 +208,7 @@ class News extends Auth
public function getHistory() public function getHistory()
{ {
$query = $this->_query('DataNewsXCollect'); $query = $this->_query('DataNewsXCollect');
$query->where(['uid' => $this->uuid, 'type' => 3, 'status' => 2]); $query->where(['uuid' => $this->uuid, 'type' => 3, 'status' => 2]);
$result = $query->order('id desc')->page(true, false, false, 15); $result = $query->order('id desc')->page(true, false, false, 15);
NewsService::instance()->buildListByUidAndCode($result['list']); NewsService::instance()->buildListByUidAndCode($result['list']);
$this->success('获取浏览历史成功!', $result); $this->success('获取浏览历史成功!', $result);

View File

@ -37,7 +37,7 @@ class Order extends Auth
*/ */
public function get() public function get()
{ {
$map = ['uid' => $this->uuid, 'deleted_status' => 0]; $map = ['uuid' => $this->uuid, 'deleted_status' => 0];
$query = $this->_query('ShopOrder')->in('status')->equal('order_no'); $query = $this->_query('ShopOrder')->in('status')->equal('order_no');
$result = $query->where($map)->order('id desc')->page(true, false, false, 20); $result = $query->where($map)->order('id desc')->page(true, false, false, 20);
if (count($result['list']) > 0) OrderService::instance()->buildData($result['list']); if (count($result['list']) > 0) OrderService::instance()->buildData($result['list']);
@ -59,7 +59,7 @@ class Order extends Auth
if (empty($rules)) $this->error('商品不能为空'); if (empty($rules)) $this->error('商品不能为空');
// 订单数据 // 订单数据
[$items, $order, $truckType, $allowPayments] = [[], [], -1, null]; [$items, $order, $truckType, $allowPayments] = [[], [], -1, null];
$order['uid'] = $this->uuid; $order['uuid'] = $this->uuid;
$order['order_no'] = CodeExtend::uniqidDate(18, 'N'); $order['order_no'] = CodeExtend::uniqidDate(18, 'N');
// 代理处理 // 代理处理
$order['puid1'] = input('from', $this->user['pid1']); $order['puid1'] = input('from', $this->user['pid1']);
@ -81,7 +81,7 @@ class Order extends Auth
if ($truckType !== $goodsInfo['truck_type']) $this->error('不能混合下单'); if ($truckType !== $goodsInfo['truck_type']) $this->error('不能混合下单');
// 限制购买数量 // 限制购买数量
if (isset($goods['limit_max_num']) && $goods['limit_max_num'] > 0) { if (isset($goods['limit_max_num']) && $goods['limit_max_num'] > 0) {
$map = [['a.uid', '=', $this->uuid], ['a.status', 'in', [2, 3, 4, 5]], ['b.goods_code', '=', $goods['code']]]; $map = [['a.uuid', '=', $this->uuid], ['a.status', 'in', [2, 3, 4, 5]], ['b.goods_code', '=', $goods['code']]];
$buys = $this->app->db->name('StoreOrder')->alias('a')->join('store_order_item b', 'a.order_no=b.order_no')->where($map)->sum('b.stock_sales'); $buys = $this->app->db->name('StoreOrder')->alias('a')->join('store_order_item b', 'a.order_no=b.order_no')->where($map)->sum('b.stock_sales');
if ($buys + $count > $goods['limit_max_num']) $this->error('超过限购数量'); if ($buys + $count > $goods['limit_max_num']) $this->error('超过限购数量');
} }
@ -103,7 +103,7 @@ class Order extends Auth
[$discountId, $discountRate] = OrderService::instance()->discount($goodsInfo['discount_id'], $this->user['vip_code']); [$discountId, $discountRate] = OrderService::instance()->discount($goodsInfo['discount_id'], $this->user['vip_code']);
// 订单详情处理 // 订单详情处理
$items[] = [ $items[] = [
'uid' => $order['uid'], 'uuid' => $order['uuid'],
'order_no' => $order['order_no'], 'order_no' => $order['order_no'],
// 商品信息字段 // 商品信息字段
'goods_name' => $goodsInfo['name'], 'goods_name' => $goodsInfo['name'],
@ -205,16 +205,16 @@ class Order extends Auth
public function express() public function express()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'code.require' => '地址不能为空', 'code.require' => '地址不能为空',
'order_no.require' => '单号不能为空', 'order_no.require' => '单号不能为空',
]); ]);
// 用户收货地址 // 用户收货地址
$map = ['uid' => $this->uuid, 'code' => $data['code']]; $map = ['uuid' => $this->uuid, 'code' => $data['code']];
$addr = $this->app->db->name('DataUserAddress')->where($map)->find(); $addr = $this->app->db->name('DataUserAddress')->where($map)->find();
if (empty($addr)) $this->error('收货地址异常'); if (empty($addr)) $this->error('收货地址异常');
// 订单状态检查 // 订单状态检查
$map = ['uid' => $this->uuid, 'order_no' => $data['order_no']]; $map = ['uuid' => $this->uuid, 'order_no' => $data['order_no']];
$tCount = $this->app->db->name('ShopOrderItem')->where($map)->sum('truck_number'); $tCount = $this->app->db->name('ShopOrderItem')->where($map)->sum('truck_number');
// 根据地址计算运费 // 根据地址计算运费
$map = ['status' => 1, 'deleted' => 0, 'order_no' => $data['order_no']]; $map = ['status' => 1, 'deleted' => 0, 'order_no' => $data['order_no']];
@ -232,16 +232,16 @@ class Order extends Auth
public function perfect() public function perfect()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'code.require' => '地址不能为空', 'code.require' => '地址不能为空',
'order_no.require' => '单号不能为空', 'order_no.require' => '单号不能为空',
]); ]);
// 用户收货地址 // 用户收货地址
$map = ['uid' => $this->uuid, 'code' => $data['code'], 'deleted' => 0]; $map = ['uuid' => $this->uuid, 'code' => $data['code'], 'deleted' => 0];
$addr = $this->app->db->name('DataUserAddress')->where($map)->find(); $addr = $this->app->db->name('DataUserAddress')->where($map)->find();
if (empty($addr)) $this->error('收货地址异常'); if (empty($addr)) $this->error('收货地址异常');
// 订单状态检查 // 订单状态检查
$map1 = ['uid' => $this->uuid, 'order_no' => $data['order_no']]; $map1 = ['uuid' => $this->uuid, 'order_no' => $data['order_no']];
$order = $this->app->db->name('ShopOrder')->where($map1)->whereIn('status', [1, 2])->find(); $order = $this->app->db->name('ShopOrder')->where($map1)->whereIn('status', [1, 2])->find();
if (empty($order)) $this->error('不能修改地址'); if (empty($order)) $this->error('不能修改地址');
if (empty($order['truck_type'])) $this->success('无需快递配送', ['order_no' => $order['order_no']]); if (empty($order['truck_type'])) $this->success('无需快递配送', ['order_no' => $order['order_no']]);
@ -252,7 +252,7 @@ class Order extends Auth
[$amount, $tCount, $tCode, $remark] = ExpressService::instance()->amount($tCodes, $addr['province'], $addr['city'], $tCount); [$amount, $tCount, $tCode, $remark] = ExpressService::instance()->amount($tCodes, $addr['province'], $addr['city'], $tCount);
// 创建订单发货信息 // 创建订单发货信息
$express = [ $express = [
'template_code' => $tCode, 'template_count' => $tCount, 'uid' => $this->uuid, 'template_code' => $tCode, 'template_count' => $tCount, 'uuid' => $this->uuid,
'template_remark' => $remark, 'template_amount' => $amount, 'status' => 1, 'template_remark' => $remark, 'template_amount' => $amount, 'status' => 1,
]; ];
$express['order_no'] = $data['order_no']; $express['order_no'] = $data['order_no'];
@ -282,7 +282,7 @@ class Order extends Auth
if ($update['amount_real'] <= 0) $update['amount_real'] = 0.00; if ($update['amount_real'] <= 0) $update['amount_real'] = 0.00;
if ($update['amount_total'] <= 0) $update['amount_total'] = 0.00; if ($update['amount_total'] <= 0) $update['amount_total'] = 0.00;
// 更新用户订单数据 // 更新用户订单数据
$map = ['uid' => $this->uuid, 'order_no' => $data['order_no']]; $map = ['uuid' => $this->uuid, 'order_no' => $data['order_no']];
if ($this->app->db->name('ShopOrder')->where($map)->update($update) !== false) { if ($this->app->db->name('ShopOrder')->where($map)->update($update) !== false) {
// 触发订单确认事件 // 触发订单确认事件
$this->app->event->trigger('ShopOrderPerfect', $order['order_no']); $this->app->event->trigger('ShopOrderPerfect', $order['order_no']);
@ -298,7 +298,7 @@ class Order extends Auth
*/ */
public function channel() public function channel()
{ {
$data = $this->_vali(['uid.value' => $this->uuid, 'order_no.require' => '单号不能为空']); $data = $this->_vali(['uuid.value' => $this->uuid, 'order_no.require' => '单号不能为空']);
$payments = $this->app->db->name('ShopOrder')->where($data)->value('payment_allow'); $payments = $this->app->db->name('ShopOrder')->where($data)->value('payment_allow');
if (empty($payments)) $this->error('获取订单支付参数失败'); if (empty($payments)) $this->error('获取订单支付参数失败');
// 读取支付通道配置 // 读取支付通道配置
@ -318,7 +318,7 @@ class Order extends Auth
public function payment() public function payment()
{ {
$data = $this->_vali([ $data = $this->_vali([
'uid.value' => $this->uuid, 'uuid.value' => $this->uuid,
'order_no.require' => '单号不能为空', 'order_no.require' => '单号不能为空',
'order_remark.default' => '', 'order_remark.default' => '',
'payment_code.require' => '支付不能为空', 'payment_code.require' => '支付不能为空',
@ -443,7 +443,7 @@ class Order extends Auth
*/ */
private function getOrderData(): array private function getOrderData(): array
{ {
$map = $this->_vali(['uid.value' => $this->uuid, 'order_no.require' => '单号不能为空']); $map = $this->_vali(['uuid.value' => $this->uuid, 'order_no.require' => '单号不能为空']);
$order = $this->app->db->name('ShopOrder')->where($map)->find(); $order = $this->app->db->name('ShopOrder')->where($map)->find();
if (empty($order)) $this->error('读取订单失败'); if (empty($order)) $this->error('读取订单失败');
return [$map, $order]; return [$map, $order];
@ -455,7 +455,7 @@ class Order extends Auth
public function total() public function total()
{ {
$data = ['t0' => 0, 't1' => 0, 't2' => 0, 't3' => 0, 't4' => 0, 't5' => 0, 't6' => 0]; $data = ['t0' => 0, 't1' => 0, 't2' => 0, 't3' => 0, 't4' => 0, 't5' => 0, 't6' => 0];
$query = $this->app->db->name('ShopOrder')->where(['uid' => $this->uuid, 'deleted_status' => 0]); $query = $this->app->db->name('ShopOrder')->where(['uuid' => $this->uuid, 'deleted_status' => 0]);
foreach ($query->field('status,count(1) count')->group('status')->cursor() as $item) { foreach ($query->field('status,count(1) count')->group('status')->cursor() as $item) {
$data["t{$item['status']}"] = $item['count']; $data["t{$item['status']}"] = $item['count'];
} }

View File

@ -27,7 +27,7 @@ class Rebate extends Auth
public function get() public function get()
{ {
$date = trim(input('date', date('Y-m')), '-'); $date = trim(input('date', date('Y-m')), '-');
[$map, $year] = [['uid' => $this->uuid], substr($date, 0, 4)]; [$map, $year] = [['uuid' => $this->uuid], substr($date, 0, 4)];
$query = $this->_query($this->table)->where($map)->equal('type,status')->whereLike('date', "{$date}%"); $query = $this->_query($this->table)->where($map)->equal('type,status')->whereLike('date', "{$date}%");
$this->success('获取返利统计', array_merge($query->order('id desc')->page(true, false, false, 10), [ $this->success('获取返利统计', array_merge($query->order('id desc')->page(true, false, false, 10), [
'total' => [ 'total' => [

View File

@ -41,7 +41,7 @@ class Transfer extends Auth
$transfers = UserTransferService::instance()->config('transfer'); $transfers = UserTransferService::instance()->config('transfer');
if (empty($transfers[$data['type']]['state'])) $this->error('提现方式已停用!'); if (empty($transfers[$data['type']]['state'])) $this->error('提现方式已停用!');
// 提现数据补充 // 提现数据补充
$data['uid'] = $this->uuid; $data['uuid'] = $this->uuid;
$data['date'] = date('Y-m-d'); $data['date'] = date('Y-m-d');
$data['code'] = CodeExtend::uniqidDate(20, 'T'); $data['code'] = CodeExtend::uniqidDate(20, 'T');
// 提现状态处理 // 提现状态处理
@ -83,7 +83,7 @@ class Transfer extends Auth
$this->error('转账方式不存在!'); $this->error('转账方式不存在!');
} }
// 当日提现次数限制 // 当日提现次数限制
$map = ['uid' => $this->uuid, 'type' => $data['type'], 'date' => $data['date']]; $map = ['uuid' => $this->uuid, 'type' => $data['type'], 'date' => $data['date']];
$count = $this->app->db->name($this->table)->where($map)->count(); $count = $this->app->db->name($this->table)->where($map)->count();
if ($count >= $transfers[$data['type']]['dayNumber']) $this->error("当日提现次数受限"); if ($count >= $transfers[$data['type']]['dayNumber']) $this->error("当日提现次数受限");
// 提现金额范围控制 // 提现金额范围控制
@ -110,10 +110,10 @@ class Transfer extends Auth
*/ */
public function get() public function get()
{ {
$query = $this->_query($this->table)->where(['uid' => $this->uuid]); $query = $this->_query($this->table)->where(['uuid' => $this->uuid]);
$result = $query->like('date,code')->in('status')->order('id desc')->page(true, false, false, 10); $result = $query->like('date,code')->in('status')->order('id desc')->page(true, false, false, 10);
// 统计历史数据 // 统计历史数据
$map = [['uid', '=', $this->uuid], ['status', '>', 0]]; $map = [['uuid', '=', $this->uuid], ['status', '>', 0]];
[$total, $count, $locks] = UserRebateService::instance()->amount($this->uuid); [$total, $count, $locks] = UserRebateService::instance()->amount($this->uuid);
$this->success('获取提现成功', array_merge($result, [ $this->success('获取提现成功', array_merge($result, [
'total' => [ 'total' => [
@ -132,7 +132,7 @@ class Transfer extends Auth
*/ */
public function cancel() public function cancel()
{ {
$data = $this->_vali(['uid.value' => $this->uuid, 'code.require' => '单号不能为空!']); $data = $this->_vali(['uuid.value' => $this->uuid, 'code.require' => '单号不能为空!']);
$this->app->db->name($this->table)->where($data)->whereIn('status', [1, 2, 3])->update([ $this->app->db->name($this->table)->where($data)->whereIn('status', [1, 2, 3])->update([
'status' => 0, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动取消提现', 'status' => 0, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动取消提现',
]); ]);
@ -146,7 +146,7 @@ class Transfer extends Auth
*/ */
public function confirm() public function confirm()
{ {
$data = $this->_vali(['uid.value' => $this->uuid, 'code.require' => '单号不能为空!']); $data = $this->_vali(['uuid.value' => $this->uuid, 'code.require' => '单号不能为空!']);
$this->app->db->name($this->table)->where($data)->whereIn('status', [4])->update([ $this->app->db->name($this->table)->where($data)->whereIn('status', [4])->update([
'status' => 5, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动确认收款', 'status' => 5, 'change_time' => date("Y-m-d H:i:s"), 'change_desc' => '用户主动确认收款',
]); ]);

View File

@ -62,7 +62,7 @@ class Order extends Controller
if ($db->getOptions('where')) $query->whereRaw("order_no in {$db->field('order_no')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("order_no in {$db->field('order_no')->buildSql()}");
// 用户搜索查询 // 用户搜索查询
$db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db(); $db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("uuid in {$db->field('id')->buildSql()}");
// 代理搜索查询 // 代理搜索查询
$db = $this->_query('DataUser')->like('phone#from_phone,nickname#from_nickname')->db(); $db = $this->_query('DataUser')->like('phone#from_phone,nickname#from_nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("puid1 in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("puid1 in {$db->field('id')->buildSql()}");

View File

@ -47,7 +47,7 @@ class Send extends Controller
$query->like('address_phone,address_name,address_province|address_city|address_area|address_content#address_content'); $query->like('address_phone,address_name,address_province|address_city|address_area|address_content#address_content');
// 用户搜索查询 // 用户搜索查询
$db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db(); $db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("uuid in {$db->field('id')->buildSql()}");
// 订单搜索查询 // 订单搜索查询
$db = $this->app->db->name('ShopOrder')->whereIn('status', [4, 5, 6])->where(['truck_type' => 1]); $db = $this->app->db->name('ShopOrder')->whereIn('status', [4, 5, 6])->where(['truck_type' => 1]);
$query->whereRaw("order_no in {$db->field('order_no')->buildSql()}"); $query->whereRaw("order_no in {$db->field('order_no')->buildSql()}");

View File

@ -143,10 +143,10 @@ class Admin extends Controller
{ {
if ($this->request->isGet()) { if ($this->request->isGet()) {
$this->upgrades = UserUpgradeService::instance()->levels(); $this->upgrades = UserUpgradeService::instance()->levels();
$data = $this->_vali(['uid.require' => '待操作UID不能为空']); $data = $this->_vali(['uuid.require' => '待操作UID不能为空']);
// 排除下级用户 // 排除下级用户
$path = $this->app->db->name($this->table)->where(['id' => $data['uid']])->value('path', '-'); $path = $this->app->db->name($this->table)->where(['id' => $data['uuid']])->value('path', '-');
$subids = $this->app->db->name($this->table)->whereLike('path', "{$path}{$data['uid']}-%")->column('id'); $subids = $this->app->db->name($this->table)->whereLike('path', "{$path}{$data['uuid']}-%")->column('id');
$query = $this->_query($this->table)->order('id desc')->whereNotIn('id', array_merge($subids, array_values($data))); $query = $this->_query($this->table)->order('id desc')->whereNotIn('id', array_merge($subids, array_values($data)));
// 用户搜索查询 // 用户搜索查询
$db = $this->_query($this->table)->equal('vip_code#from_vipcode')->like('phone#from_phone,username|nickname#from_username')->db(); $db = $this->_query($this->table)->equal('vip_code#from_vipcode')->like('phone#from_phone,username|nickname#from_username')->db();
@ -154,9 +154,9 @@ class Admin extends Controller
// 数据查询分页 // 数据查询分页
$query->like('phone,username|nickname#username')->whereRaw('vip_code>0')->equal('status,vip_code')->dateBetween('create_at')->page(); $query->like('phone,username|nickname#username')->whereRaw('vip_code>0')->equal('status,vip_code')->dateBetween('create_at')->page();
} else { } else {
$data = $this->_vali(['pid.require' => '待绑定代理不能为空!', 'uid.require' => '待操作用户不能为空!']); $data = $this->_vali(['pid.require' => '待绑定代理不能为空!', 'uuid.require' => '待操作用户不能为空!']);
[$status, $message] = UserUpgradeService::instance()->bindAgent($data['uid'], $data['pid'], 2); [$status, $message] = UserUpgradeService::instance()->bindAgent($data['uuid'], $data['pid'], 2);
$status && sysoplog('前端用户管理', "修改用户[{$data['uid']}]的代理为用户[{$data['pid']}]"); $status && sysoplog('前端用户管理', "修改用户[{$data['uuid']}]的代理为用户[{$data['pid']}]");
empty($status) ? $this->error($message) : $this->success($message); empty($status) ? $this->error($message) : $this->success($message);
} }
} }

View File

@ -41,7 +41,7 @@ class Balance extends Controller
$query = $this->_query($this->table)->equal('name,upgrade'); $query = $this->_query($this->table)->equal('name,upgrade');
// 用户搜索查询 // 用户搜索查询
$db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db(); $db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("uuid in {$db->field('id')->buildSql()}");
// 数据查询分页 // 数据查询分页
$query->where(['deleted' => 0])->like('code,remark')->dateBetween('create_at')->order('id desc')->page(); $query->where(['deleted' => 0])->like('code,remark')->dateBetween('create_at')->order('id desc')->page();
} }
@ -71,8 +71,8 @@ class Balance extends Controller
*/ */
public function add() public function add()
{ {
$data = $this->_vali(['uid.require' => '用户UID不能为空']); $data = $this->_vali(['uuid.require' => '用户UID不能为空']);
$this->user = $this->app->db->name('DataUser')->where(['id' => $data['uid']])->find(); $this->user = $this->app->db->name('DataUser')->where(['id' => $data['uuid']])->find();
if (empty($this->user)) $this->error('待充值的用户不存在!'); if (empty($this->user)) $this->error('待充值的用户不存在!');
$this->_form($this->table, 'form'); $this->_form($this->table, 'form');
} }
@ -105,9 +105,9 @@ class Balance extends Controller
*/ */
protected function _form_result(bool $state, array $data) protected function _form_result(bool $state, array $data)
{ {
if ($state && isset($data['uid'])) { if ($state && isset($data['uuid'])) {
UserBalanceService::instance()->amount($data['uid']); UserBalanceService::instance()->amount($data['uuid']);
UserUpgradeService::instance()->upgrade($data['uid']); UserUpgradeService::instance()->upgrade($data['uuid']);
} }
} }
@ -132,8 +132,8 @@ class Balance extends Controller
if ($state) { if ($state) {
$map = [['id', 'in', str2arr(input('id', ''))]]; $map = [['id', 'in', str2arr(input('id', ''))]];
foreach ($this->app->db->name($this->table)->where($map)->cursor() as $vo) { foreach ($this->app->db->name($this->table)->where($map)->cursor() as $vo) {
UserBalanceService::instance()->amount($vo['uid']); UserBalanceService::instance()->amount($vo['uuid']);
UserUpgradeService::instance()->upgrade($vo['uid']); UserUpgradeService::instance()->upgrade($vo['uuid']);
} }
} }
} }

View File

@ -42,7 +42,7 @@ class Rebate extends Controller
if ($db->getOptions('where')) $query->whereRaw("order_uid in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("order_uid in {$db->field('id')->buildSql()}");
// 代理条件查询 // 代理条件查询
$db = $this->_query('DataUser')->like('nickname#agent_nickname,phone#agent_phone')->db(); $db = $this->_query('DataUser')->like('nickname#agent_nickname,phone#agent_phone')->db();
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("uuid in {$db->field('id')->buildSql()}");
// 查询分页 // 查询分页
$query->dateBetween('create_at')->order('id desc')->page(); $query->dateBetween('create_at')->order('id desc')->page();
} }
@ -56,14 +56,14 @@ class Rebate extends Controller
*/ */
protected function _index_page_filter(array &$data) protected function _index_page_filter(array &$data)
{ {
$uids = array_merge(array_column($data, 'uid'), array_column($data, 'order_uid')); $uids = array_merge(array_column($data, 'uuid'), array_column($data, 'order_uid'));
$userItem = $this->app->db->name('DataUser')->whereIn('id', array_unique($uids))->select(); $userItem = $this->app->db->name('DataUser')->whereIn('id', array_unique($uids))->select();
$goodsItem = $this->app->db->name('ShopOrderItem')->whereIn('order_no', array_unique(array_column($data, 'order_no')))->select(); $goodsItem = $this->app->db->name('ShopOrderItem')->whereIn('order_no', array_unique(array_column($data, 'order_no')))->select();
foreach ($data as &$vo) { foreach ($data as &$vo) {
$vo['type'] = RebateService::instance()->name($vo['type']); $vo['type'] = RebateService::instance()->name($vo['type']);
[$vo['user'], $vo['agent'], $vo['list']] = [[], [], []]; [$vo['user'], $vo['agent'], $vo['list']] = [[], [], []];
foreach ($userItem as $user) { foreach ($userItem as $user) {
if ($user['id'] === $vo['uid']) $vo['agent'] = $user; if ($user['id'] === $vo['uuid']) $vo['agent'] = $user;
if ($user['id'] === $vo['order_uid']) $vo['user'] = $user; if ($user['id'] === $vo['order_uid']) $vo['user'] = $user;
} }
foreach ($goodsItem as $goods) { foreach ($goodsItem as $goods) {

View File

@ -92,7 +92,7 @@ class Transfer extends Controller
$query = $this->_query($this->table)->order('id desc'); $query = $this->_query($this->table)->order('id desc');
// 用户条件搜索 // 用户条件搜索
$db = $this->_query('DataUser')->like('phone,username|nickname#nickname')->db(); $db = $this->_query('DataUser')->like('phone,username|nickname#nickname')->db();
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}"); if ($db->getOptions('where')) $query->whereRaw("uuid in {$db->field('id')->buildSql()}");
// 数据列表处理 // 数据列表处理
$query->equal('type,status')->dateBetween('create_at')->page(); $query->equal('type,status')->dateBetween('create_at')->page();
} }

View File

@ -45,7 +45,7 @@ class NewsService extends Service
foreach ($list as &$vo) $vo['record'] = $items[$vo['code']] ?? []; foreach ($list as &$vo) $vo['record'] = $items[$vo['code']] ?? [];
/*! 绑定用户数据 */ /*! 绑定用户数据 */
$colls = 'id,phone,nickname,username,headimg,status'; $colls = 'id,phone,nickname,username,headimg,status';
UserAdminService::instance()->buildByUid($list, 'uid', 'user', $colls); UserAdminService::instance()->buildByUid($list, 'uuid', 'user', $colls);
} }
return $list; return $list;
} }
@ -53,16 +53,16 @@ class NewsService extends Service
/** /**
* 获取列表状态 * 获取列表状态
* @param array $list 数据列表 * @param array $list 数据列表
* @param integer $uid 用户UID * @param integer $uuid 用户UID
* @return array * @return array
*/ */
public function buildData(array &$list, int $uid = 0): array public function buildData(array &$list, int $uuid = 0): array
{ {
if (count($list) > 0) { if (count($list) > 0) {
[$code2, $code1] = [[], []]; [$code2, $code1] = [[], []];
$marks = $this->app->db->name('DataNewsMark')->where(['status' => 1])->column('name'); $marks = $this->app->db->name('DataNewsMark')->where(['status' => 1])->column('name');
if ($uid > 0) { if ($uuid > 0) {
$map = [['uid', '=', $uid], ['code', 'in', array_unique(array_column($list, 'code'))]]; $map = [['uuid', '=', $uuid], ['code', 'in', array_unique(array_column($list, 'code'))]];
$code1 = $this->app->db->name('DataNewsXCollect')->where($map)->where(['type' => 1])->column('code'); $code1 = $this->app->db->name('DataNewsXCollect')->where($map)->where(['type' => 1])->column('code');
$code2 = $this->app->db->name('DataNewsXCollect')->where($map)->where(['type' => 2])->column('code'); $code2 = $this->app->db->name('DataNewsXCollect')->where($map)->where(['type' => 2])->column('code');
} }

View File

@ -51,17 +51,17 @@ class OrderService extends Service
$order = $this->app->db->name('ShopOrder')->where($map)->find(); $order = $this->app->db->name('ShopOrder')->where($map)->find();
if (empty($order)) return null; if (empty($order)) return null;
// 订单用户数据 // 订单用户数据
$user = $this->app->db->name('DataUser')->where(['id' => $order['uid']])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $order['uuid']])->find();
if (empty($user)) return null; if (empty($user)) return null;
// 更新用户购买资格 // 更新用户购买资格
$entry = $this->vipEntry($order['uid']); $entry = $this->vipEntry($order['uuid']);
// 尝试绑定代理用户 // 尝试绑定代理用户
if (empty($user['pids']) && ($order['puid1'] > 0 || $user['pid1'] > 0)) { if (empty($user['pids']) && ($order['puid1'] > 0 || $user['pid1'] > 0)) {
$puid1 = $order['puid1'] > 0 ? $order['puid1'] : $user['pid0']; $puid1 = $order['puid1'] > 0 ? $order['puid1'] : $user['pid0'];
UserUpgradeService::instance()->bindAgent($user['id'], $puid1); UserUpgradeService::instance()->bindAgent($user['id'], $puid1);
} }
// 重置用户信息并绑定订单 // 重置用户信息并绑定订单
$user = $this->app->db->name('DataUser')->where(['id' => $order['uid']])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $order['uuid']])->find();
if ($user['pid1'] > 0) { if ($user['pid1'] > 0) {
$this->app->db->name('ShopOrder')->where(['order_no' => $orderNo])->update([ $this->app->db->name('ShopOrder')->where(['order_no' => $orderNo])->update([
'puid1' => $user['pid1'], 'puid2' => $user['pid2'], 'puid1' => $user['pid1'], 'puid2' => $user['pid2'],
@ -74,21 +74,21 @@ class OrderService extends Service
/** /**
* 刷新用户入会礼包 * 刷新用户入会礼包
* @param integer $uid 用户UID * @param integer $uuid 用户UID
* @return integer * @return integer
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
*/ */
private function vipEntry(int $uid): int private function vipEntry(int $uuid): int
{ {
// 检查是否购买入会礼包 // 检查是否购买入会礼包
$query = $this->app->db->table('shop_order a')->join('shop_order_item b', 'a.order_no=b.order_no'); $query = $this->app->db->table('shop_order a')->join('shop_order_item b', 'a.order_no=b.order_no');
$entry = $query->where("a.uid={$uid} and a.status>=4 and a.payment_status=1 and b.vip_entry>0")->count() ? 1 : 0; $entry = $query->where("a.uuid={$uuid} and a.status>=4 and a.payment_status=1 and b.vip_entry>0")->count() ? 1 : 0;
// 用户最后支付时间 // 用户最后支付时间
$query = $this->app->db->name('ShopOrder'); $query = $this->app->db->name('ShopOrder');
$lastMap = [['uid', '=', $uid], ['status', '>=', 4], ['payment_status', '=', 1]]; $lastMap = [['uuid', '=', $uuid], ['status', '>=', 4], ['payment_status', '=', 1]];
$lastDate = $query->where($lastMap)->order('payment_datetime desc')->value('payment_datetime'); $lastDate = $query->where($lastMap)->order('payment_datetime desc')->value('payment_datetime');
// 更新用户支付信息 // 更新用户支付信息
$this->app->db->name('DataUser')->where(['id' => $uid])->update(['buy_vip_entry' => $entry, 'buy_last_date' => $lastDate]); $this->app->db->name('DataUser')->where(['id' => $uuid])->update(['buy_vip_entry' => $entry, 'buy_last_date' => $lastDate]);
return $entry; return $entry;
} }
@ -127,13 +127,13 @@ class OrderService extends Service
// 关联发货信息 // 关联发货信息
$nobs = array_unique(array_column($data, 'order_no')); $nobs = array_unique(array_column($data, 'order_no'));
$trucks = $this->app->db->name('ShopOrderSend')->whereIn('order_no', $nobs)->column('*', 'order_no'); $trucks = $this->app->db->name('ShopOrderSend')->whereIn('order_no', $nobs)->column('*', 'order_no');
foreach ($trucks as &$item) unset($item['id'], $item['uid'], $item['status'], $item['deleted'], $item['create_at']); foreach ($trucks as &$item) unset($item['id'], $item['uuid'], $item['status'], $item['deleted'], $item['create_at']);
// 关联订单商品 // 关联订单商品
$query = $this->app->db->name('ShopOrderItem')->where(['status' => 1, 'deleted' => 0]); $query = $this->app->db->name('ShopOrderItem')->where(['status' => 1, 'deleted' => 0]);
$items = $query->withoutField('id,uid,status,deleted,create_at')->whereIn('order_no', $nobs)->select()->toArray(); $items = $query->withoutField('id,uuid,status,deleted,create_at')->whereIn('order_no', $nobs)->select()->toArray();
// 关联用户数据 // 关联用户数据
$fields = 'phone,username,nickname,headimg,status,vip_code,vip_name'; $fields = 'phone,username,nickname,headimg,status,vip_code,vip_name';
if ($data) UserAdminService::instance()->buildByUid($data, 'uid', 'user', $fields); if ($data) UserAdminService::instance()->buildByUid($data, 'uuid', 'user', $fields);
if ($from) UserAdminService::instance()->buildByUid($data, 'puid1', 'from', $fields); if ($from) UserAdminService::instance()->buildByUid($data, 'puid1', 'from', $fields);
foreach ($data as &$vo) { foreach ($data as &$vo) {
[$vo['sales'], $vo['truck'], $vo['items']] = [0, $trucks[$vo['order_no']] ?? [], []]; [$vo['sales'], $vo['truck'], $vo['items']] = [0, $trucks[$vo['order_no']] ?? [], []];

View File

@ -82,7 +82,7 @@ class RebateService extends Service
if ($this->order['amount_total'] <= 0) throw new Exception('订单金额为零'); if ($this->order['amount_total'] <= 0) throw new Exception('订单金额为零');
if ($this->order['rebate_amount'] <= 0) throw new Exception('订单返利为零'); if ($this->order['rebate_amount'] <= 0) throw new Exception('订单返利为零');
// 获取用户数据 // 获取用户数据
$map = ['id' => $this->order['uid'], 'deleted' => 0]; $map = ['id' => $this->order['uuid'], 'deleted' => 0];
$this->user = $this->app->db->name('DataUser')->where($map)->find(); $this->user = $this->app->db->name('DataUser')->where($map)->find();
if (empty($this->user)) throw new Exception('用户不存在'); if (empty($this->user)) throw new Exception('用户不存在');
// 获取直接代理数据 // 获取直接代理数据
@ -150,7 +150,7 @@ class RebateService extends Service
if (!$this->checkPrizeStatus(self::PRIZE_01, $this->from1['vip_code'])) return false; if (!$this->checkPrizeStatus(self::PRIZE_01, $this->from1['vip_code'])) return false;
// 创建返利奖励记录 // 创建返利奖励记录
$key = "{$this->from1['vip_code']}_{$this->user['vip_code']}"; $key = "{$this->from1['vip_code']}_{$this->user['vip_code']}";
$map = ['type' => self::PRIZE_01, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']]; $map = ['type' => self::PRIZE_01, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uuid']];
if ($this->config("frist_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->config("frist_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) {
$value = $this->config("frist_value_vip_{$key}"); $value = $this->config("frist_value_vip_{$key}");
if ($this->config("frist_type_vip_{$key}") == 1) { if ($this->config("frist_type_vip_{$key}") == 1) {
@ -190,27 +190,27 @@ class RebateService extends Service
/** /**
* 写返利记录 * 写返利记录
* @param int $uid * @param int $uuid
* @param array $map * @param array $map
* @param string $name * @param string $name
* @param float $amount * @param float $amount
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
*/ */
private function writeRabate(int $uid, array $map, string $name, float $amount) private function writeRabate(int $uuid, array $map, string $name, float $amount)
{ {
$this->app->db->name($this->table)->insert(array_merge($map, [ $this->app->db->name($this->table)->insert(array_merge($map, [
'uid' => $uid, 'uuid' => $uuid,
'date' => date('Y-m-d'), 'date' => date('Y-m-d'),
'code' => CodeExtend::uniqidDate(20, 'R'), 'code' => CodeExtend::uniqidDate(20, 'R'),
'name' => $name, 'name' => $name,
'amount' => $amount, 'amount' => $amount,
'status' => $this->status, 'status' => $this->status,
'order_no' => $this->order['order_no'], 'order_no' => $this->order['order_no'],
'order_uid' => $this->order['uid'], 'order_uid' => $this->order['uuid'],
'order_amount' => $this->order['amount_total'], 'order_amount' => $this->order['amount_total'],
])); ]));
// 刷新用户返利统计 // 刷新用户返利统计
UserRebateService::instance()->amount($uid); UserRebateService::instance()->amount($uuid);
} }
/** /**
@ -231,7 +231,7 @@ class RebateService extends Service
if (!$this->checkPrizeStatus(self::PRIZE_02, $this->from1['vip_code'])) return false; if (!$this->checkPrizeStatus(self::PRIZE_02, $this->from1['vip_code'])) return false;
// 创建返利奖励记录 // 创建返利奖励记录
$key = "vip_{$this->from1['vip_code']}_{$this->user['vip_code']}"; $key = "vip_{$this->from1['vip_code']}_{$this->user['vip_code']}";
$map = ['type' => self::PRIZE_02, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']]; $map = ['type' => self::PRIZE_02, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uuid']];
if ($this->config("repeat_state_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->config("repeat_state_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) {
$value = $this->config("repeat_value_{$key}"); $value = $this->config("repeat_value_{$key}");
if ($this->config("repeat_type_{$key}") == 1) { if ($this->config("repeat_type_{$key}") == 1) {
@ -260,7 +260,7 @@ class RebateService extends Service
if (!$this->checkPrizeStatus(self::PRIZE_03, $this->from1['vip_code'])) return false; if (!$this->checkPrizeStatus(self::PRIZE_03, $this->from1['vip_code'])) return false;
// 创建返利奖励记录 // 创建返利奖励记录
$key = "{$this->user['vip_code']}"; $key = "{$this->user['vip_code']}";
$map = ['type' => self::PRIZE_03, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']]; $map = ['type' => self::PRIZE_03, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uuid']];
if ($this->config("direct_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->config("direct_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) {
$value = $this->config("direct_value_vip_{$key}"); $value = $this->config("direct_value_vip_{$key}");
if ($this->config("direct_type_vip_{$key}") == 1) { if ($this->config("direct_type_vip_{$key}") == 1) {
@ -288,7 +288,7 @@ class RebateService extends Service
if (empty($this->from2)) return false; if (empty($this->from2)) return false;
if (!$this->checkPrizeStatus(self::PRIZE_04, $this->from2['vip_code'])) return false; if (!$this->checkPrizeStatus(self::PRIZE_04, $this->from2['vip_code'])) return false;
$key = "{$this->user['vip_code']}"; $key = "{$this->user['vip_code']}";
$map = ['type' => self::PRIZE_04, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']]; $map = ['type' => self::PRIZE_04, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uuid']];
if ($this->config("indirect_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->config("indirect_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) {
$value = $this->config("indirect_value_vip_{$key}"); $value = $this->config("indirect_value_vip_{$key}");
if ($this->config("indirect_type_vip_{$key}") == 1) { if ($this->config("indirect_type_vip_{$key}") == 1) {
@ -325,7 +325,7 @@ class RebateService extends Service
[$tVip, $tRate] = [$item['vip_code'], $item['discount_rate']]; [$tVip, $tRate] = [$item['vip_code'], $item['discount_rate']];
foreach ($rules as $rule) if ($rule['level'] > $tVip) foreach ($users as $user) if ($user['vip_code'] > $tVip) { foreach ($rules as $rule) if ($rule['level'] > $tVip) foreach ($users as $user) if ($user['vip_code'] > $tVip) {
if ($tRate > $rule['discount'] && $tRate < 100) { if ($tRate > $rule['discount'] && $tRate < 100) {
$map = ['uid' => $user['id'], 'type' => self::PRIZE_05]; $map = ['uuid' => $user['id'], 'type' => self::PRIZE_05];
$map['code'] = "{$this->order['order_no']}#{$item['id']}#{$tVip}.{$user['vip_code']}"; $map['code'] = "{$this->order['order_no']}#{$item['id']}#{$tVip}.{$user['vip_code']}";
if ($this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->app->db->name($this->table)->where($map)->count() < 1) {
$dRate = ($tRate - $rule['discount']) / 100; $dRate = ($tRate - $rule['discount']) / 100;
@ -360,7 +360,7 @@ class RebateService extends Service
foreach ($this->app->db->name('DataUser')->whereIn('vip_code', $vips)->whereIn('id', $puids)->orderField('id', $puids)->cursor() as $user) { foreach ($this->app->db->name('DataUser')->whereIn('vip_code', $vips)->whereIn('id', $puids)->orderField('id', $puids)->cursor() as $user) {
if ($user['vip_code'] > $prevLevel) { if ($user['vip_code'] > $prevLevel) {
if (($amount = $this->_prize06amount($prevLevel + 1, $user['vip_code'])) > 0.00) { if (($amount = $this->_prize06amount($prevLevel + 1, $user['vip_code'])) > 0.00) {
$map = ['uid' => $user['id'], 'type' => self::PRIZE_06, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']]; $map = ['uuid' => $user['id'], 'type' => self::PRIZE_06, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uuid']];
if ($this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->app->db->name($this->table)->where($map)->count() < 1) {
$name = "{$this->name(self::PRIZE_06)}[ VIP{$prevLevel} > VIP{$user['vip_code']} ] 每单 {$amount}"; $name = "{$this->name(self::PRIZE_06)}[ VIP{$prevLevel} > VIP{$user['vip_code']} ] 每单 {$amount}";
$this->writeRabate($user['id'], $map, $name, $amount); $this->writeRabate($user['id'], $map, $name, $amount);
@ -413,7 +413,7 @@ class RebateService extends Service
if (!$this->checkPrizeStatus(self::PRIZE_07, $this->from1['vip_code'])) return false; if (!$this->checkPrizeStatus(self::PRIZE_07, $this->from1['vip_code'])) return false;
// 创建返利奖励记录 // 创建返利奖励记录
$key = "{$this->user['vip_code']}"; $key = "{$this->user['vip_code']}";
$map = ['type' => self::PRIZE_07, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uid']]; $map = ['type' => self::PRIZE_07, 'order_no' => $this->order['order_no'], 'order_uid' => $this->order['uuid']];
if ($this->config("upgrade_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) { if ($this->config("upgrade_state_vip_{$key}") && $this->app->db->name($this->table)->where($map)->count() < 1) {
$value = $this->config("upgrade_value_vip_{$key}"); $value = $this->config("upgrade_value_vip_{$key}");
if ($this->config("upgrade_type_vip_{$key}") == 1) { if ($this->config("upgrade_type_vip_{$key}") == 1) {

View File

@ -89,7 +89,7 @@ class UserAdminService extends Service
$user = $this->app->db->name('DataUser')->where($map)->find(); $user = $this->app->db->name('DataUser')->where($map)->find();
if (empty($user)) throw new Exception('指定UID用户不存在'); if (empty($user)) throw new Exception('指定UID用户不存在');
if (!is_null($type)) { if (!is_null($type)) {
$map = ['uid' => $uuid, 'type' => $type]; $map = ['uuid' => $uuid, 'type' => $type];
$data = $this->app->db->name('DataUserToken')->where($map)->find(); $data = $this->app->db->name('DataUserToken')->where($map)->find();
if (empty($data)) { if (empty($data)) {
[$state, $info, $data] = UserTokenService::instance()->token($uuid, $type); [$state, $info, $data] = UserTokenService::instance()->token($uuid, $type);
@ -123,8 +123,8 @@ class UserAdminService extends Service
{ {
if (!empty($unionid)) { if (!empty($unionid)) {
[$map1, $map2] = [[['unionid', '=', $unionid]], [[$field, '=', $openid]]]; [$map1, $map2] = [[['unionid', '=', $unionid]], [[$field, '=', $openid]]];
if ($uid = $this->app->db->name('DataUser')->whereOr([$map1, $map2])->value('id')) { if ($uuid = $this->app->db->name('DataUser')->whereOr([$map1, $map2])->value('id')) {
return ['id' => $uid]; return ['id' => $uuid];
} }
} }
return [$field => $openid]; return [$field => $openid];
@ -138,7 +138,7 @@ class UserAdminService extends Service
* @param string $cols 返回用户字段 * @param string $cols 返回用户字段
* @return array * @return array
*/ */
public function buildByUid(array &$list, string $keys = 'uid', string $bind = 'user', string $cols = '*'): array public function buildByUid(array &$list, string $keys = 'uuid', string $bind = 'user', string $cols = '*'): array
{ {
if (count($list) < 1) return $list; if (count($list) < 1) return $list;
$uids = array_unique(array_column($list, $keys)); $uids = array_unique(array_column($list, $keys));

View File

@ -28,14 +28,14 @@ class UserBalanceService extends Service
if (empty($order)) throw new \think\admin\Exception('需处理的订单状态异常'); if (empty($order)) throw new \think\admin\Exception('需处理的订单状态异常');
if ($order['reward_balance'] > 0) data_save('DataUserBalance', [ if ($order['reward_balance'] > 0) data_save('DataUserBalance', [
'uid' => $order['uid'], 'uuid' => $order['uuid'],
'code' => "CZ{$order['order_no']}", 'code' => "CZ{$order['order_no']}",
'name' => "订单余额充值", 'name' => "订单余额充值",
'remark' => "来自订单 {$order['order_no']} 的余额充值 {$order['reward_balance']}", 'remark' => "来自订单 {$order['order_no']} 的余额充值 {$order['reward_balance']}",
'amount' => $order['reward_balance'], 'amount' => $order['reward_balance'],
], 'code'); ], 'code');
return $this->amount($order['uid']); return $this->amount($order['uuid']);
} }
/** /**
@ -48,12 +48,12 @@ class UserBalanceService extends Service
public function amount(int $uuid, array $nots = []): array public function amount(int $uuid, array $nots = []): array
{ {
if ($uuid > 0) { if ($uuid > 0) {
$total = abs($this->app->db->name('DataUserBalance')->whereRaw("uid='{$uuid}' and amount>0 and deleted=0")->sum('amount')); $total = abs($this->app->db->name('DataUserBalance')->whereRaw("uuid='{$uuid}' and amount>0 and deleted=0")->sum('amount'));
$count = abs($this->app->db->name('DataUserBalance')->whereRaw("uid='{$uuid}' and amount<0 and deleted=0")->sum('amount')); $count = abs($this->app->db->name('DataUserBalance')->whereRaw("uuid='{$uuid}' and amount<0 and deleted=0")->sum('amount'));
if (empty($nots)) { if (empty($nots)) {
$this->app->db->name('DataUser')->where(['id' => $uuid])->update(['balance_total' => $total, 'balance_used' => $count]); $this->app->db->name('DataUser')->where(['id' => $uuid])->update(['balance_total' => $total, 'balance_used' => $count]);
} else { } else {
$count -= $this->app->db->name('DataUserBalance')->whereRaw("uid={$uuid}")->whereIn('code', $nots)->sum('amount'); $count -= $this->app->db->name('DataUserBalance')->whereRaw("uuid={$uuid}")->whereIn('code', $nots)->sum('amount');
} }
} else { } else {
$total = abs($this->app->db->name('DataUserBalance')->whereRaw("amount>0 and deleted=0")->sum('amount')); $total = abs($this->app->db->name('DataUserBalance')->whereRaw("amount>0 and deleted=0")->sum('amount'));

View File

@ -20,9 +20,9 @@ class UserRebateService extends Service
public function amount(int $uuid): array public function amount(int $uuid): array
{ {
if ($uuid > 0) { if ($uuid > 0) {
$count = $this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status>0")->sum('amount'); $count = $this->app->db->name('DataUserTransfer')->whereRaw("uuid='{$uuid}' and status>0")->sum('amount');
$total = $this->app->db->name('DataUserRebate')->whereRaw("uid='{$uuid}' and status=1 and deleted=0")->sum('amount'); $total = $this->app->db->name('DataUserRebate')->whereRaw("uuid='{$uuid}' and status=1 and deleted=0")->sum('amount');
$locks = $this->app->db->name('DataUserRebate')->whereRaw("uid='{$uuid}' and status=0 and deleted=0")->sum('amount'); $locks = $this->app->db->name('DataUserRebate')->whereRaw("uuid='{$uuid}' and status=0 and deleted=0")->sum('amount');
$this->app->db->name('DataUser')->where(['id' => $uuid])->update(['rebate_total' => $total, 'rebate_used' => $count, 'rebate_lock' => $locks]); $this->app->db->name('DataUser')->where(['id' => $uuid])->update(['rebate_total' => $total, 'rebate_used' => $count, 'rebate_lock' => $locks]);
} else { } else {
$count = $this->app->db->name('DataUserTransfer')->whereRaw("status>0")->sum('amount'); $count = $this->app->db->name('DataUserTransfer')->whereRaw("status>0")->sum('amount');
@ -48,7 +48,7 @@ class UserRebateService extends Service
$map = [['status', '=', 0], ['order_no', 'like', "{$orderNo}%"]]; $map = [['status', '=', 0], ['order_no', 'like', "{$orderNo}%"]];
$this->app->db->name('DataUserRebate')->where($map)->update(['status' => 1]); $this->app->db->name('DataUserRebate')->where($map)->update(['status' => 1]);
if (UserUpgradeService::instance()->upgrade($order['uid'])) { if (UserUpgradeService::instance()->upgrade($order['uuid'])) {
return [1, '重新计算用户金额成功!']; return [1, '重新计算用户金额成功!'];
} else { } else {
return [0, '重新计算用户金额失败!']; return [0, '重新计算用户金额失败!'];

View File

@ -37,7 +37,7 @@ class UserTokenService extends Service
$map = ['type' => $type, 'token' => $token]; $map = ['type' => $type, 'token' => $token];
$data = $this->app->db->name('DataUserToken')->where($map)->find(); $data = $this->app->db->name('DataUserToken')->where($map)->find();
} }
if (empty($data) || empty($data['uid'])) { if (empty($data) || empty($data['uuid'])) {
return [0, '请重新登录,登录认证无效', 0, 0]; return [0, '请重新登录,登录认证无效', 0, 0];
} elseif ($token !== 'token' && $data['time'] < time()) { } elseif ($token !== 'token' && $data['time'] < time()) {
return [0, '请重新登录,登录认证失效', 0, 0]; return [0, '请重新登录,登录认证失效', 0, 0];
@ -45,7 +45,7 @@ class UserTokenService extends Service
return [0, '请重新登录,客户端已更换', 0, 0]; return [0, '请重新登录,客户端已更换', 0, 0];
} else { } else {
$this->expire($type, $token); $this->expire($type, $token);
return [1, '登录验证成功', $data['uid'], $data['time']]; return [1, '登录验证成功', $data['uuid'], $data['time']];
} }
} }
@ -84,13 +84,13 @@ class UserTokenService extends Service
// 清理无效认证数据 // 清理无效认证数据
$time = time(); $time = time();
$map1 = [['token', '<>', 'token'], ['time', '<', $time]]; $map1 = [['token', '<>', 'token'], ['time', '<', $time]];
$map2 = [['token', '<>', 'token'], ['type', '=', $type], ['uid', '=', $uuid]]; $map2 = [['token', '<>', 'token'], ['type', '=', $type], ['uuid', '=', $uuid]];
$this->app->db->name('DataUserToken')->whereOr([$map1, $map2])->delete(); $this->app->db->name('DataUserToken')->whereOr([$map1, $map2])->delete();
// 创建新的认证数据 // 创建新的认证数据
do $map = ['type' => $type, 'token' => md5(uniqid() . rand(100, 999))]; do $map = ['type' => $type, 'token' => md5(uniqid() . rand(100, 999))];
while ($this->app->db->name('DataUserToken')->where($map)->count() > 0); while ($this->app->db->name('DataUserToken')->where($map)->count() > 0);
// 写入用户认证数据 // 写入用户认证数据
$data = array_merge($map, ['uid' => $uuid, 'time' => $time + $this->expire, 'tokenv' => $this->_buildTokenVerify()]); $data = array_merge($map, ['uuid' => $uuid, 'time' => $time + $this->expire, 'tokenv' => $this->_buildTokenVerify()]);
if ($this->app->db->name('DataUserToken')->insert($data) !== false) { if ($this->app->db->name('DataUserToken')->insert($data) !== false) {
return [1, '刷新认证成功', $data]; return [1, '刷新认证成功', $data];
} else { } else {

View File

@ -100,10 +100,10 @@ class UserTransferService extends Service
public function amount(int $uuid): array public function amount(int $uuid): array
{ {
if ($uuid > 0) { if ($uuid > 0) {
$locks = abs($this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status=3")->sum('amount')); $locks = abs($this->app->db->name('DataUserTransfer')->whereRaw("uuid='{$uuid}' and status=3")->sum('amount'));
$total = abs($this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status>=1")->sum('amount')); $total = abs($this->app->db->name('DataUserTransfer')->whereRaw("uuid='{$uuid}' and status>=1")->sum('amount'));
$count = abs($this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status>=4")->sum('amount')); $count = abs($this->app->db->name('DataUserTransfer')->whereRaw("uuid='{$uuid}' and status>=4")->sum('amount'));
$audit = abs($this->app->db->name('DataUserTransfer')->whereRaw("uid='{$uuid}' and status>=1 and status<3")->sum('amount')); $audit = abs($this->app->db->name('DataUserTransfer')->whereRaw("uuid='{$uuid}' and status>=1 and status<3")->sum('amount'));
} else { } else {
$locks = abs($this->app->db->name('DataUserTransfer')->whereRaw("status=3")->sum('amount')); $locks = abs($this->app->db->name('DataUserTransfer')->whereRaw("status=3")->sum('amount'));
$total = abs($this->app->db->name('DataUserTransfer')->whereRaw("status>=1")->sum('amount')); $total = abs($this->app->db->name('DataUserTransfer')->whereRaw("status>=1")->sum('amount'));

View File

@ -24,7 +24,7 @@ class UserUpgradeService extends Service
/** /**
* 尝试绑定上级代理 * 尝试绑定上级代理
* @param integer $uid 用户UID * @param integer $uuid 用户UID
* @param integer $pid 代理UID * @param integer $pid 代理UID
* @param integer $mod 操作类型0临时绑定, 1永久绑定, 2强行绑定) * @param integer $mod 操作类型0临时绑定, 1永久绑定, 2强行绑定)
* @return array * @return array
@ -32,19 +32,19 @@ class UserUpgradeService extends Service
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
*/ */
public function bindAgent(int $uid, int $pid = 0, int $mod = 1): array public function bindAgent(int $uuid, int $pid = 0, int $mod = 1): array
{ {
$user = $this->app->db->name('DataUser')->where(['id' => $uid])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $uuid])->find();
if (empty($user)) return [0, '用户查询失败']; if (empty($user)) return [0, '用户查询失败'];
if ($user['pids'] && in_array($mod, [0, 1])) return [1, '已经绑定代理']; if ($user['pids'] && in_array($mod, [0, 1])) return [1, '已经绑定代理'];
// 检查代理用户 // 检查代理用户
if (empty($pid)) $pid = $user['pid0']; if (empty($pid)) $pid = $user['pid0'];
if (empty($pid)) return [0, '绑定的代理不存在']; if (empty($pid)) return [0, '绑定的代理不存在'];
if ($uid == $pid) return [0, '不能绑定自己为代理']; if ($uuid == $pid) return [0, '不能绑定自己为代理'];
// 检查代理资格 // 检查代理资格
$agent = $this->app->db->name('DataUser')->where(['id' => $pid])->find(); $agent = $this->app->db->name('DataUser')->where(['id' => $pid])->find();
if (empty($agent['vip_code'])) return [0, '代理无推荐资格']; if (empty($agent['vip_code'])) return [0, '代理无推荐资格'];
if (stripos($agent['path'], "-{$uid}-") !== false) return [0, '不能绑定下属']; if (stripos($agent['path'], "-{$uuid}-") !== false) return [0, '不能绑定下属'];
// 组装代理数据 // 组装代理数据
try { try {
@ -75,7 +75,7 @@ class UserUpgradeService extends Service
/** /**
* 同步计算用户等级 * 同步计算用户等级
* @param integer $uid 指定用户UID * @param integer $uuid 指定用户UID
* @param boolean $parent 同步计算上级 * @param boolean $parent 同步计算上级
* @param ?string $orderNo 升级触发订单 * @param ?string $orderNo 升级触发订单
* @return boolean * @return boolean
@ -83,18 +83,18 @@ class UserUpgradeService extends Service
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
*/ */
public function upgrade(int $uid, bool $parent = true, ?string $orderNo = null): bool public function upgrade(int $uuid, bool $parent = true, ?string $orderNo = null): bool
{ {
$user = $this->app->db->name('DataUser')->where(['id' => $uid])->find(); $user = $this->app->db->name('DataUser')->where(['id' => $uuid])->find();
if (empty($user)) return true; if (empty($user)) return true;
// 初始化等级参数 // 初始化等级参数
$levels = $this->levels(); $levels = $this->levels();
[$vipName, $vipCode, $vipTeam] = [$levels[0]['name'] ?? '普通用户', 0, []]; [$vipName, $vipCode, $vipTeam] = [$levels[0]['name'] ?? '普通用户', 0, []];
// 统计用户数据 // 统计用户数据
foreach ($levels as $key => $level) if ($level['upgrade_team'] === 1) $vipTeam[] = $key; foreach ($levels as $key => $level) if ($level['upgrade_team'] === 1) $vipTeam[] = $key;
$orderAmount = $this->app->db->name('ShopOrder')->where("uid={$uid} and status>=4")->sum('amount_total'); $orderAmount = $this->app->db->name('ShopOrder')->where("uuid={$uuid} and status>=4")->sum('amount_total');
$teamsDirect = $this->app->db->name('DataUser')->where(['pid1' => $uid])->whereIn('vip_code', $vipTeam)->count(); $teamsDirect = $this->app->db->name('DataUser')->where(['pid1' => $uuid])->whereIn('vip_code', $vipTeam)->count();
$teamsIndirect = $this->app->db->name('DataUser')->where(['pid2' => $uid])->whereIn('vip_code', $vipTeam)->count(); $teamsIndirect = $this->app->db->name('DataUser')->where(['pid2' => $uuid])->whereIn('vip_code', $vipTeam)->count();
$teamsUsers = $teamsDirect + $teamsIndirect; $teamsUsers = $teamsDirect + $teamsIndirect;
// 动态计算用户等级 // 动态计算用户等级
foreach ($levels as $item) { foreach ($levels as $item) {
@ -114,21 +114,21 @@ class UserUpgradeService extends Service
} }
// 购买入会商品升级 // 购买入会商品升级
$query = $this->app->db->name('ShopOrderItem')->alias('b')->join('shop_order a', 'b.order_no=a.order_no'); $query = $this->app->db->name('ShopOrderItem')->alias('b')->join('shop_order a', 'b.order_no=a.order_no');
$tmpCode = $query->whereRaw("a.uid={$uid} and a.payment_status=1 and a.status>=4 and b.vip_entry=1")->max('b.vip_upgrade'); $tmpCode = $query->whereRaw("a.uuid={$uuid} and a.payment_status=1 and a.status>=4 and b.vip_entry=1")->max('b.vip_upgrade');
if ($tmpCode > $vipCode && isset($levels[$tmpCode])) { if ($tmpCode > $vipCode && isset($levels[$tmpCode])) {
[$vipName, $vipCode] = [$levels[$tmpCode]['name'], $levels[$tmpCode]['number']]; [$vipName, $vipCode] = [$levels[$tmpCode]['name'], $levels[$tmpCode]['number']];
} else { } else {
$orderNo = null; $orderNo = null;
} }
// 后台余额充值升级 // 后台余额充值升级
$tmpCode = $this->app->db->name('DataUserBalance')->where(['uid' => $uid, 'deleted' => 0])->max('upgrade'); $tmpCode = $this->app->db->name('DataUserBalance')->where(['uuid' => $uuid, 'deleted' => 0])->max('upgrade');
if ($tmpCode > $vipCode && isset($levels[$tmpCode])) { if ($tmpCode > $vipCode && isset($levels[$tmpCode])) {
[$vipName, $vipCode] = [$levels[$tmpCode]['name'], $levels[$tmpCode]['number']]; [$vipName, $vipCode] = [$levels[$tmpCode]['name'], $levels[$tmpCode]['number']];
} }
// 统计用户订单金额 // 统计用户订单金额
$orderAmountTotal = $this->app->db->name('ShopOrder')->whereRaw("uid={$uid} and status>=4")->sum('amount_goods'); $orderAmountTotal = $this->app->db->name('ShopOrder')->whereRaw("uuid={$uuid} and status>=4")->sum('amount_goods');
$teamsAmountDirect = $this->app->db->name('ShopOrder')->whereRaw("puid1={$uid} and status>=4")->sum('amount_goods'); $teamsAmountDirect = $this->app->db->name('ShopOrder')->whereRaw("puid1={$uuid} and status>=4")->sum('amount_goods');
$teamsAmountIndirect = $this->app->db->name('ShopOrder')->whereRaw("puid2={$uid} and status>=4")->sum('amount_goods'); $teamsAmountIndirect = $this->app->db->name('ShopOrder')->whereRaw("puid2={$uuid} and status>=4")->sum('amount_goods');
// 更新用户团队数据 // 更新用户团队数据
$data = [ $data = [
'vip_name' => $vipName, 'vip_name' => $vipName,
@ -143,10 +143,10 @@ class UserUpgradeService extends Service
]; ];
if (!empty($orderNo)) $data['vip_order'] = $orderNo; if (!empty($orderNo)) $data['vip_order'] = $orderNo;
if ($data['vip_code'] !== $user['vip_code']) $data['vip_datetime'] = date('Y-m-d H:i:s'); if ($data['vip_code'] !== $user['vip_code']) $data['vip_datetime'] = date('Y-m-d H:i:s');
$this->app->db->name('DataUser')->where(['id' => $uid])->update($data); $this->app->db->name('DataUser')->where(['id' => $uuid])->update($data);
// 用户升级事件 // 用户升级事件
if ($user['vip_code'] < $vipCode) $this->app->event->trigger('UserUpgradeLevel', [ if ($user['vip_code'] < $vipCode) $this->app->event->trigger('UserUpgradeLevel', [
'uid' => $user['id'], 'order_no' => $orderNo, 'vip_code_old' => $user['vip_code'], 'vip_code_new' => $vipCode, 'uuid' => $user['id'], 'order_no' => $orderNo, 'vip_code_old' => $user['vip_code'], 'vip_code_new' => $vipCode,
]); ]);
return !($parent && $user['pid1'] > 0) || $this->upgrade($user['pid1'], false); return !($parent && $user['pid1'] > 0) || $this->upgrade($user['pid1'], false);
} }

View File

@ -56,7 +56,7 @@ class BalancePyamentService extends PaymentService
// 创建支付行为 // 创建支付行为
$this->createPaymentAction($orderNo, $paymentTitle, $paymentAmount); $this->createPaymentAction($orderNo, $paymentTitle, $paymentAmount);
// 检查能否支付 // 检查能否支付
[$total, $count] = UserBalanceService::instance()->amount($order['uid'], [$orderNo]); [$total, $count] = UserBalanceService::instance()->amount($order['uuid'], [$orderNo]);
if ($paymentAmount > $total - $count) throw new Exception("可抵扣余额不足"); if ($paymentAmount > $total - $count) throw new Exception("可抵扣余额不足");
try { try {
// 扣减用户余额 // 扣减用户余额
@ -67,7 +67,7 @@ class BalancePyamentService extends PaymentService
]); ]);
// 扣除余额金额 // 扣除余额金额
data_save('DataUserBalance', [ data_save('DataUserBalance', [
'uid' => $order['uid'], 'uuid' => $order['uuid'],
'code' => "KC{$order['order_no']}", 'code' => "KC{$order['order_no']}",
'name' => "账户余额支付", 'name' => "账户余额支付",
'remark' => "支付订单 {$order['order_no']} 的扣除余额 {$paymentAmount}", 'remark' => "支付订单 {$order['order_no']} 的扣除余额 {$paymentAmount}",
@ -77,7 +77,7 @@ class BalancePyamentService extends PaymentService
$this->updatePaymentAction($order['order_no'], CodeExtend::uniqidDate(20), $paymentAmount, '账户余额支付'); $this->updatePaymentAction($order['order_no'], CodeExtend::uniqidDate(20), $paymentAmount, '账户余额支付');
}); });
// 刷新用户余额 // 刷新用户余额
UserBalanceService::instance()->amount($order['uid']); UserBalanceService::instance()->amount($order['uuid']);
return ['code' => 1, 'info' => '余额支付完成']; return ['code' => 1, 'info' => '余额支付完成'];
} catch (\Exception $exception) { } catch (\Exception $exception) {
return ['code' => 0, 'info' => $exception->getMessage()]; return ['code' => 0, 'info' => $exception->getMessage()];

View File

@ -103,7 +103,7 @@
代理关联:<!--{notempty name='vo.pids'}--> 代理关联:<!--{notempty name='vo.pids'}-->
<b class="color-green">永久绑定</b> <b class="color-green">永久绑定</b>
<!--{if auth('parent')}--> <!--{if auth('parent')}-->
<a data-width="1080px" data-height="700px" data-iframe="{:url('parent')}?uid={$vo.id}" class="margin-left-5 notselect">更改绑定</a> <a data-width="1080px" data-height="700px" data-iframe="{:url('parent')}?uuid={$vo.id}" class="margin-left-5 notselect">更改绑定</a>
<!--{/if}--> <!--{/if}-->
<!--{else}--> <!--{else}-->
{notempty name='vo.pid0'} {notempty name='vo.pid0'}
@ -114,7 +114,7 @@
{else} {else}
<b class="color-desc">没有绑定</b> <b class="color-desc">没有绑定</b>
<!--{if auth('parent')}--> <!--{if auth('parent')}-->
<a data-width="1080px" data-height="700px" data-iframe="{:url('parent')}?uid={$vo.id}" class="margin-left-5 notselect">设置绑定</a> <a data-width="1080px" data-height="700px" data-iframe="{:url('parent')}?uuid={$vo.id}" class="margin-left-5 notselect">设置绑定</a>
<!--{/if}--> <!--{/if}-->
{/notempty} {/notempty}
<!--{/notempty}--> <!--{/notempty}-->
@ -132,11 +132,11 @@
<td class="nowrap"> <td class="nowrap">
<!--{if auth("parent") and false}--> <!--{if auth("parent") and false}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-iframe="{:url('parent')}?uid={$vo.id}" data-width="900px">修改上级</a> <a class="layui-btn layui-btn-sm layui-btn-primary" data-iframe="{:url('parent')}?uuid={$vo.id}" data-width="900px">修改上级</a>
<!--{/if}--> <!--{/if}-->
<!--{if auth("user.balance/add")}--> <!--{if auth("user.balance/add")}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('user.balance/add')}?uid={$vo.id}" data-title="充值账户余额"> </a> <a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('user.balance/add')}?uuid={$vo.id}" data-title="充值账户余额"> </a>
<!--{/if}--> <!--{/if}-->
<!--{if auth("state") and $vo.status eq 1}--> <!--{if auth("state") and $vo.status eq 1}-->

View File

@ -62,7 +62,7 @@
</td> </td>
<td class="nowrap text-right"> <td class="nowrap text-right">
<!--{if auth("parent")}--> <!--{if auth("parent")}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-parent-uid="{:input('uid')}" data-parent-pid="{$vo.id}">选择绑定</a> <a class="layui-btn layui-btn-sm layui-btn-primary" data-parent-uuid="{:input('uuid')}" data-parent-pid="{$vo.id}">选择绑定</a>
<!--{/if}--> <!--{/if}-->
</td> </td>
</tr> </tr>
@ -75,8 +75,8 @@
{block name='script'} {block name='script'}
<script> <script>
$('body').off('click', '[data-parent-uid]').on('click', '[data-parent-uid]', function () { $('body').off('click', '[data-parent-uuid]').on('click', '[data-parent-uuid]', function () {
$.form.load('{:sysuri()}', {uid: this.dataset.parentUid, pid: this.dataset.parentPid}, 'post', function (ret) { $.form.load('{:sysuri()}', {uuid: this.dataset.parentUid, pid: this.dataset.parentPid}, 'post', function (ret) {
if (ret.code > 0) return $.msg.success(ret.info, 3, function () { if (ret.code > 0) return $.msg.success(ret.info, 3, function () {
top.layer.close(top.layer.getFrameIndex(window.name)); top.layer.close(top.layer.getFrameIndex(window.name));
top.$.form.reload(); top.$.form.reload();

View File

@ -6,9 +6,9 @@
<script> <script>
(function (inst1) { (function (inst1) {
// 加载指定用户下级 // 加载指定用户下级
function loaded(uid) { function loaded(uuid) {
var deferred = jQuery.Deferred(); var deferred = jQuery.Deferred();
$.form.load('{:url("teams")}', {output: 'json', from: uid}, 'get', function (ret) { $.form.load('{:url("teams")}', {output: 'json', from: uuid}, 'get', function (ret) {
var data = []; var data = [];
ret.data.list.forEach(function (item) { ret.data.list.forEach(function (item) {
data.push({ data.push({

View File

@ -68,7 +68,7 @@
</div> </div>
<div class="hr-line-dashed"></div> <div class="hr-line-dashed"></div>
<input name='uid' type='hidden' value='{$vo.uid|default=$user.id}'> <input name='uuid' type='hidden' value='{$vo.uuid|default=$user.id}'>
{notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty} {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}
<div class="layui-form-item text-center"> <div class="layui-form-item text-center">