修改数据表

This commit is contained in:
邹景立 2021-03-26 15:39:47 +08:00
parent 894409560e
commit a0655bb8ca
10 changed files with 108 additions and 108 deletions

View File

@ -11,12 +11,77 @@
Target Server Version : 50562 Target Server Version : 50562
File Encoding : 65001 File Encoding : 65001
Date: 26/03/2021 15:18:31 Date: 26/03/2021 15:39:38
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0; SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for data_base_discount
-- ----------------------------
DROP TABLE IF EXISTS `data_base_discount`;
CREATE TABLE `data_base_discount` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方案名称',
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '方案规则',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方案描述',
`sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重',
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '方案状态(1使用,0禁用)',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_base_discount_status`(`status`) USING BTREE,
INDEX `idx_data_base_discount_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-基础-折扣' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for data_base_notify
-- ----------------------------
DROP TABLE IF EXISTS `data_base_notify`;
CREATE TABLE `data_base_notify` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '消息类型',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '消息名称',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '消息内容',
`sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重',
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '消息状态(1使用,0禁用)',
`deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_base_notify_type`(`type`) USING BTREE,
INDEX `idx_data_base_notify_status`(`status`) USING BTREE,
INDEX `idx_data_base_notify_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-基础-通知' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for data_base_upgrade
-- ----------------------------
DROP TABLE IF EXISTS `data_base_upgrade`;
CREATE TABLE `data_base_upgrade` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户级别名称',
`number` tinyint(2) NULL DEFAULT 0 COMMENT '用户级别序号',
`rebate_rule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户奖利规则',
`upgrade_type` tinyint(1) NULL DEFAULT 0 COMMENT '会员升级规则(0单个,1同时)',
`goods_vip_status` tinyint(1) NULL DEFAULT 0 COMMENT '入会礼包状态',
`order_amount_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单金额状态',
`order_amount_number` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额累计',
`teams_users_status` tinyint(1) NULL DEFAULT 0 COMMENT '团队人数状态',
`teams_users_number` bigint(20) NULL DEFAULT 0 COMMENT '团队人数累计',
`teams_direct_status` tinyint(1) NULL DEFAULT 0 COMMENT '直推人数状态',
`teams_direct_number` bigint(20) NULL DEFAULT 0 COMMENT '直推人数累计',
`teams_indirect_status` tinyint(1) NULL DEFAULT 0 COMMENT '间推人数状态',
`teams_indirect_number` bigint(20) NULL DEFAULT 0 COMMENT '间推人数累计',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户级别描述',
`utime` bigint(20) NULL DEFAULT 0 COMMENT '等级更新时间',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '用户等级状态(1使用,0禁用)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '等级创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_base_upgrade_status`(`status`) USING BTREE,
INDEX `idx_data_base_upgrade_number`(`number`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-基础-等级' ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Table structure for data_news_item -- Table structure for data_news_item
-- ---------------------------- -- ----------------------------
@ -189,24 +254,6 @@ CREATE TABLE `data_user_balance` (
INDEX `idx_data_user_balance_deleted`(`deleted`) USING BTREE INDEX `idx_data_user_balance_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-用户-余额' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-用户-余额' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for data_user_discount
-- ----------------------------
DROP TABLE IF EXISTS `data_user_discount`;
CREATE TABLE `data_user_discount` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方案名称',
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '方案规则',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方案描述',
`sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重',
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '方案状态(1使用,0禁用)',
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_user_discount_status`(`status`) USING BTREE,
INDEX `idx_data_user_discount_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-用户-折扣' ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_message -- Table structure for data_user_message
-- ---------------------------- -- ----------------------------
@ -228,25 +275,6 @@ CREATE TABLE `data_user_message` (
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_general_ci COMMENT = '数据-用户-短信' ROW_FORMAT = COMPACT; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-用户-短信' ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for data_user_notify
-- ----------------------------
DROP TABLE IF EXISTS `data_user_notify`;
CREATE TABLE `data_user_notify` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '消息类型',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '消息名称',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '消息内容',
`sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重',
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '消息状态(1使用,0禁用)',
`deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_user_notify_type`(`type`) USING BTREE,
INDEX `idx_data_user_notify_status`(`status`) USING BTREE,
INDEX `idx_data_user_notify_deleted`(`deleted`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-用户-通知' ROW_FORMAT = COMPACT;
-- ---------------------------- -- ----------------------------
-- Table structure for data_user_rebate -- Table structure for data_user_rebate
-- ---------------------------- -- ----------------------------
@ -336,34 +364,6 @@ CREATE TABLE `data_user_transfer` (
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 = utf8 COLLATE = utf8_general_ci COMMENT = '数据-用户-提现' ROW_FORMAT = Compact; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据-用户-提现' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for data_user_upgrade
-- ----------------------------
DROP TABLE IF EXISTS `data_user_upgrade`;
CREATE TABLE `data_user_upgrade` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户级别名称',
`number` tinyint(2) NULL DEFAULT 0 COMMENT '用户级别序号',
`rebate_rule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户奖利规则',
`upgrade_type` tinyint(1) NULL DEFAULT 0 COMMENT '会员升级规则(0单个,1同时)',
`goods_vip_status` tinyint(1) NULL DEFAULT 0 COMMENT '入会礼包状态',
`order_amount_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单金额状态',
`order_amount_number` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额累计',
`teams_users_status` tinyint(1) NULL DEFAULT 0 COMMENT '团队人数状态',
`teams_users_number` bigint(20) NULL DEFAULT 0 COMMENT '团队人数累计',
`teams_direct_status` tinyint(1) NULL DEFAULT 0 COMMENT '直推人数状态',
`teams_direct_number` bigint(20) NULL DEFAULT 0 COMMENT '直推人数累计',
`teams_indirect_status` tinyint(1) NULL DEFAULT 0 COMMENT '间推人数状态',
`teams_indirect_number` bigint(20) NULL DEFAULT 0 COMMENT '间推人数累计',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户级别描述',
`utime` bigint(20) NULL DEFAULT 0 COMMENT '等级更新时间',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '用户等级状态(1使用,0禁用)',
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '等级创建时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_data_user_upgrade_status`(`status`) USING BTREE,
INDEX `idx_data_user_upgrade_number`(`number`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-用户-等级' ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Table structure for shop_goods -- Table structure for shop_goods
-- ---------------------------- -- ----------------------------
@ -493,10 +493,10 @@ CREATE TABLE `shop_goods_stock` (
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 '用户编号', `uid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '下单用户编号',
`puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐用户1', `puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐一层用户',
`puid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐用户2', `puid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐二层用户',
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单编', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品订单单',
`amount_real` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单实际金额', `amount_real` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单实际金额',
`amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单统计金额', `amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单统计金额',
`amount_goods` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品统计金额', `amount_goods` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品统计金额',
@ -517,7 +517,7 @@ CREATE TABLE `shop_order` (
`payment_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付到账时间', `payment_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付到账时间',
`number_goods` bigint(20) NULL DEFAULT 0 COMMENT '订单商品数量', `number_goods` bigint(20) NULL DEFAULT 0 COMMENT '订单商品数量',
`number_express` bigint(20) NULL DEFAULT 0 COMMENT '订单快递计数', `number_express` bigint(20) NULL DEFAULT 0 COMMENT '订单快递计数',
`truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送(0无需配送,1需要配送)', `truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送类型(0无需配送,1需要配送)',
`order_remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单用户备注', `order_remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单用户备注',
`cancel_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单取消状态', `cancel_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单取消状态',
`cancel_remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单取消描述', `cancel_remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单取消描述',
@ -525,8 +525,8 @@ CREATE TABLE `shop_order` (
`deleted_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单删除状态(0未删,1已删)', `deleted_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单删除状态(0未删,1已删)',
`deleted_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单删除描述', `deleted_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单删除描述',
`deleted_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单删除时间', `deleted_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单删除时间',
`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`(`uid`) USING BTREE,
INDEX `idx_shop_order_from`(`puid1`) USING BTREE, INDEX `idx_shop_order_from`(`puid1`) USING BTREE,
@ -543,21 +543,21 @@ CREATE TABLE `shop_order` (
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 '用户编号', `uid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号',
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单单号', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商城订单单号',
`goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '品SKU', `goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '城商品SKU',
`goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '品编号', `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '城商品编号',
`goods_spec` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '品规格', `goods_spec` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '城商品规格',
`goods_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '品名称', `goods_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '城商品名称',
`goods_cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品图片', `goods_cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商品封面图片',
`goods_payment` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付通道', `goods_payment` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '指定支付通道',
`price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '市场单价', `price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品市场单价',
`price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '销售单价', `price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品销售单价',
`total_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '市场总价', `total_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品市场总价',
`total_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '销售总价', `total_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品销售总价',
`reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励余额', `reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品奖励余额',
`reward_integral` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励积分', `reward_integral` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品奖励积分',
`stock_sales` bigint(20) NULL DEFAULT 1 COMMENT '商品数量', `stock_sales` bigint(20) NULL DEFAULT 1 COMMENT '包含商品数量',
`vip_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户等级名称', `vip_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户等级名称',
`vip_code` bigint(20) NULL DEFAULT 0 COMMENT '用户等级序号', `vip_code` bigint(20) NULL DEFAULT 0 COMMENT '用户等级序号',
`vip_entry` tinyint(1) NULL DEFAULT 0 COMMENT '是否入会礼包(0非礼包,1是礼包)', `vip_entry` tinyint(1) NULL DEFAULT 0 COMMENT '是否入会礼包(0非礼包,1是礼包)',
@ -572,7 +572,7 @@ CREATE TABLE `shop_order_item` (
`discount_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品优惠金额', `discount_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品优惠金额',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', `status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)',
`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_item_status`(`status`) USING BTREE, INDEX `idx_shop_order_item_status`(`status`) USING BTREE,
INDEX `idx_shop_order_item_deleted`(`deleted`) USING BTREE, INDEX `idx_shop_order_item_deleted`(`deleted`) USING BTREE,
@ -589,8 +589,8 @@ CREATE TABLE `shop_order_item` (
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 '用户编号', `uid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号',
`order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单', `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '商城订单单',
`address_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '配送地址编号', `address_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '配送地址编号',
`address_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '配送收货人姓名', `address_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '配送收货人姓名',
`address_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '配送收货人手机', `address_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '配送收货人手机',
@ -611,8 +611,8 @@ CREATE TABLE `shop_order_send` (
`send_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '快递运送单号', `send_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '快递运送单号',
`send_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '快递发送备注', `send_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '快递发送备注',
`send_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '快递发送时间', `send_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '快递发送时间',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', `status` tinyint(1) NULL DEFAULT 1 COMMENT '发货商品状态(1使用,0禁用)',
`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`(`uid`) USING BTREE,

View File

@ -160,7 +160,7 @@ class ShopGoods extends Controller
$this->trucks = ExpressService::instance()->templates(); $this->trucks = ExpressService::instance()->templates();
$this->upgrades = UserUpgradeService::instance()->levels(); $this->upgrades = UserUpgradeService::instance()->levels();
$this->payments = $this->app->db->name('ShopPayment')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('type,code,name', 'code'); $this->payments = $this->app->db->name('ShopPayment')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('type,code,name', 'code');
$this->discounts = $this->app->db->name('DataUserDiscount')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('id,name,items', 'id'); $this->discounts = $this->app->db->name('DataBaseDiscount')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('id,name,items', 'id');
// 商品规格处理 // 商品规格处理
$fields = 'goods_sku `sku`,goods_code,goods_spec `key`,price_selling `selling`,price_market `market`,number_virtual `virtual`,number_express `express`,reward_balance `balance`,reward_integral `integral`,status'; $fields = 'goods_sku `sku`,goods_code,goods_spec `key`,price_selling `selling`,price_market `market`,number_virtual `virtual`,number_express `express`,reward_balance `balance`,reward_integral `integral`,status';
$data['data_items'] = json_encode($this->app->db->name('ShopGoodsItem')->where(['goods_code' => $data['code']])->column($fields, 'goods_spec'), JSON_UNESCAPED_UNICODE); $data['data_items'] = json_encode($this->app->db->name('ShopGoodsItem')->where(['goods_code' => $data['code']])->column($fields, 'goods_spec'), JSON_UNESCAPED_UNICODE);

View File

@ -16,7 +16,7 @@ class UserDiscount extends Controller
* 绑定数据表 * 绑定数据表
* @var string * @var string
*/ */
private $table = 'DataUserDiscount'; private $table = 'DataBaseDiscount';
/** /**
* 折扣方案管理 * 折扣方案管理

View File

@ -15,7 +15,7 @@ class UserNotify extends Controller
* 绑定数据表 * 绑定数据表
* @var string * @var string
*/ */
private $table = 'DataUserNotify'; private $table = 'DataBaseNotify';
/** /**
* 系统通知管理 * 系统通知管理

View File

@ -16,7 +16,7 @@ class UserUpgrade extends Controller
* 绑定数据表 * 绑定数据表
* @var string * @var string
*/ */
private $table = 'DataUserUpgrade'; private $table = 'DataBaseUpgrade';
/** /**
* 用户等级管理 * 用户等级管理

View File

@ -31,7 +31,7 @@ class Data extends Controller
*/ */
public function getNotify() public function getNotify()
{ {
$query = $this->_query('DataUserNotify')->where(['status' => 1, 'deleted' => 0]); $query = $this->_query('DataBaseNotify')->where(['status' => 1, 'deleted' => 0]);
$result = $query->equal('id')->order('sort desc,id desc')->page(true, false, false, 20); $result = $query->equal('id')->order('sort desc,id desc')->page(true, false, false, 20);
$this->success('获取系统通知数据', $result); $this->success('获取系统通知数据', $result);
} }

View File

@ -44,7 +44,7 @@ class Rebate extends Auth
{ {
[$map, $data] = [['number' => $this->user['vip_code']], []]; [$map, $data] = [['number' => $this->user['vip_code']], []];
$prizes = $this->app->db->name($this->table)->group('name')->column('name'); $prizes = $this->app->db->name($this->table)->group('name')->column('name');
$rebate = $this->app->db->name('DataUserUpgrade')->where($map)->value('rebate_rule', ''); $rebate = $this->app->db->name('DataBaseUpgrade')->where($map)->value('rebate_rule', '');
$codemap = array_merge($prizes, str2arr($rebate)); $codemap = array_merge($prizes, str2arr($rebate));
foreach (RebateService::PRIZES as $prize) { foreach (RebateService::PRIZES as $prize) {
if (in_array($prize['code'], $codemap)) $data[] = $prize; if (in_array($prize['code'], $codemap)) $data[] = $prize;

View File

@ -106,7 +106,7 @@ class OrderService extends Service
{ {
if ($disId > 0) { if ($disId > 0) {
$map = ['id' => $disId, 'status' => 1, 'deleted' => 0]; $map = ['id' => $disId, 'status' => 1, 'deleted' => 0];
$discount = $this->app->db->name('DataUserDiscount')->where($map)->value('items'); $discount = $this->app->db->name('DataBaseDiscount')->where($map)->value('items');
$disitems = json_decode($discount ?: '[]', true) ?: []; $disitems = json_decode($discount ?: '[]', true) ?: [];
if (is_array($disitems) && count($disitems) > 0) foreach ($disitems as $vo) { if (is_array($disitems) && count($disitems) > 0) foreach ($disitems as $vo) {
if ($vo['level'] == $vipCode) $disRate = floatval($vo['discount']); if ($vo['level'] == $vipCode) $disRate = floatval($vo['discount']);

View File

@ -254,12 +254,12 @@ class RebateService extends Service
$puids = array_reverse(str2arr($this->user['path'], '-')); $puids = array_reverse(str2arr($this->user['path'], '-'));
if (empty($puids) || $this->order['amount_total'] <= 0) return false; if (empty($puids) || $this->order['amount_total'] <= 0) return false;
// 获取可以参与奖励的代理 // 获取可以参与奖励的代理
$vips = $this->app->db->name('DataUserUpgrade')->whereLike('rebate_rule', '%,' . self::PRIZE_05 . ',%')->column('number'); $vips = $this->app->db->name('DataBaseUpgrade')->whereLike('rebate_rule', '%,' . self::PRIZE_05 . ',%')->column('number');
$users = $this->app->db->name('DataUser')->whereIn('vip_code', $vips)->whereIn('id', $puids)->orderField('id', $puids)->select()->toArray(); $users = $this->app->db->name('DataUser')->whereIn('vip_code', $vips)->whereIn('id', $puids)->orderField('id', $puids)->select()->toArray();
// 查询需要计算奖励的商品 // 查询需要计算奖励的商品
$map = [['order_no', '=', $this->order['order_no']], ['discount_rate', '<', 100]]; $map = [['order_no', '=', $this->order['order_no']], ['discount_rate', '<', 100]];
foreach ($this->app->db->name('ShopOrderItem')->where($map)->cursor() as $item) { foreach ($this->app->db->name('ShopOrderItem')->where($map)->cursor() as $item) {
$itemJson = $this->app->db->name('DataUserDiscount')->where(['status' => 1, 'deleted' => 0])->value('items'); $itemJson = $this->app->db->name('DataBaseDiscount')->where(['status' => 1, 'deleted' => 0])->value('items');
if (!empty($itemJson) && is_array($rules = json_decode($itemJson, true))) { if (!empty($itemJson) && is_array($rules = json_decode($itemJson, true))) {
[$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) {
@ -295,7 +295,7 @@ class RebateService extends Service
// 记录原始等级 // 记录原始等级
$prevLevel = $this->user['vip_code']; $prevLevel = $this->user['vip_code'];
// 获取可以参与奖励的代理 // 获取可以参与奖励的代理
$vips = $this->app->db->name('DataUserUpgrade')->whereLike('rebate_rule', '%,' . self::PRIZE_06 . ',%')->column('number'); $vips = $this->app->db->name('DataBaseUpgrade')->whereLike('rebate_rule', '%,' . self::PRIZE_06 . ',%')->column('number');
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) {
@ -416,6 +416,6 @@ class RebateService extends Service
private function isPrizeStatus(string $prize, int $level): bool private function isPrizeStatus(string $prize, int $level): bool
{ {
$map = [['number', '=', $level], ['rebate_rule', 'like', "%,{$prize},%"]]; $map = [['number', '=', $level], ['rebate_rule', 'like', "%,{$prize},%"]];
return $this->app->db->name('DataUserUpgrade')->where($map)->count() > 0; return $this->app->db->name('DataBaseUpgrade')->where($map)->count() > 0;
} }
} }

View File

@ -18,7 +18,7 @@ class UserUpgradeService extends Service
*/ */
public function levels(): array public function levels(): array
{ {
$query = $this->app->db->name('DataUserUpgrade'); $query = $this->app->db->name('DataBaseUpgrade');
return $query->where(['status' => 1])->order('number asc')->column('*', 'number'); return $query->where(['status' => 1])->order('number asc')->column('*', 'number');
} }
@ -44,7 +44,7 @@ class UserUpgradeService extends Service
$teamsIndirect = $this->app->db->name('DataUser')->where(['pid2' => $uid])->whereRaw('vip_code>0')->count(); $teamsIndirect = $this->app->db->name('DataUser')->where(['pid2' => $uid])->whereRaw('vip_code>0')->count();
$teamsUsers = $this->app->db->name('DataUser')->where(['pid1|pid2' => $uid])->whereRaw('vip_code>0')->count(); $teamsUsers = $this->app->db->name('DataUser')->where(['pid1|pid2' => $uid])->whereRaw('vip_code>0')->count();
// 计算用户等级 // 计算用户等级
foreach ($this->app->db->name('DataUserUpgrade')->where(['status' => 1])->order('number desc')->cursor() as $item) { foreach ($this->app->db->name('DataBaseUpgrade')->where(['status' => 1])->order('number desc')->cursor() as $item) {
$l1 = empty($item['goods_vip_status']) || $user['buy_vip_entry'] > 0; $l1 = empty($item['goods_vip_status']) || $user['buy_vip_entry'] > 0;
$l2 = empty($item['teams_users_status']) || $item['teams_users_number'] <= $teamsUsers; $l2 = empty($item['teams_users_status']) || $item['teams_users_number'] <= $teamsUsers;
$l3 = empty($item['order_amount_status']) || $item['order_amount_number'] <= $orderAmount; $l3 = empty($item['order_amount_status']) || $item['order_amount_number'] <= $orderAmount;
@ -64,7 +64,7 @@ class UserUpgradeService extends Service
$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.uid={$uid} and a.payment_status=1 and a.status>=4 and b.vip_entry=1")->max('b.vip_upgrade');
if ($tmpCode > $vipCode) { if ($tmpCode > $vipCode) {
$map = ['status' => 1, 'number' => $tmpCode]; $map = ['status' => 1, 'number' => $tmpCode];
$upgrade = $this->app->db->name('DataUserUpgrade')->where($map)->find(); $upgrade = $this->app->db->name('DataBaseUpgrade')->where($map)->find();
if (!empty($upgrade)) [$vipName, $vipCode] = [$upgrade['name'], $upgrade['number']]; if (!empty($upgrade)) [$vipName, $vipCode] = [$upgrade['name'], $upgrade['number']];
} else { } else {
$orderNo = null; $orderNo = null;
@ -73,7 +73,7 @@ class UserUpgradeService extends Service
$tmpCode = $this->app->db->name('DataUserBalance')->where(['uid' => $uid, 'deleted' => 0])->max('vip_upgrade'); $tmpCode = $this->app->db->name('DataUserBalance')->where(['uid' => $uid, 'deleted' => 0])->max('vip_upgrade');
if ($tmpCode > $vipCode) { if ($tmpCode > $vipCode) {
$map = ['status' => 1, 'number' => $tmpCode]; $map = ['status' => 1, 'number' => $tmpCode];
$upgrade = $this->app->db->name('DataUserUpgrade')->where($map)->find(); $upgrade = $this->app->db->name('DataBaseUpgrade')->where($map)->find();
if (!empty($upgrade)) [$vipName, $vipCode] = [$upgrade['name'], $upgrade['number']]; if (!empty($upgrade)) [$vipName, $vipCode] = [$upgrade['name'], $upgrade['number']];
} }
// 统计用户订单金额 // 统计用户订单金额