From a0655bb8ca7acb541091392d0bc91d86c63f9bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Fri, 26 Mar 2021 15:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SQL01-数据表结构.sql | 186 ++++++++++++------------ app/data/controller/ShopGoods.php | 2 +- app/data/controller/UserDiscount.php | 2 +- app/data/controller/UserNotify.php | 2 +- app/data/controller/UserUpgrade.php | 2 +- app/data/controller/api/Data.php | 2 +- app/data/controller/api/auth/Rebate.php | 2 +- app/data/service/OrderService.php | 2 +- app/data/service/RebateService.php | 8 +- app/data/service/UserUpgradeService.php | 8 +- 10 files changed, 108 insertions(+), 108 deletions(-) diff --git a/SQL01-数据表结构.sql b/SQL01-数据表结构.sql index 4bc383fa6..0f2e635f2 100644 --- a/SQL01-数据表结构.sql +++ b/SQL01-数据表结构.sql @@ -11,12 +11,77 @@ Target Server Version : 50562 File Encoding : 65001 - Date: 26/03/2021 15:18:31 + Date: 26/03/2021 15:39:38 */ SET NAMES utf8mb4; 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 -- ---------------------------- @@ -189,24 +254,6 @@ CREATE TABLE `data_user_balance` ( 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; --- ---------------------------- --- 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 -- ---------------------------- @@ -228,25 +275,6 @@ CREATE TABLE `data_user_message` ( 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; --- ---------------------------- --- 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 -- ---------------------------- @@ -336,34 +364,6 @@ CREATE TABLE `data_user_transfer` ( 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; --- ---------------------------- --- 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 -- ---------------------------- @@ -493,10 +493,10 @@ CREATE TABLE `shop_goods_stock` ( DROP TABLE IF EXISTS `shop_order`; CREATE TABLE `shop_order` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `uid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户编号', - `puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐用户1', - `puid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐用户2', - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单编号', + `uid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '下单用户编号', + `puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐一层用户', + `puid2` bigint(20) NULL DEFAULT 0 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_total` 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 '支付到账时间', `number_goods` 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 '订单用户备注', `cancel_status` tinyint(1) NULL DEFAULT 0 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_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 '订单删除时间', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '订单状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_shop_order_mid`(`uid`) 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`; CREATE TABLE `shop_order_item` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, - `uid` bigint(20) NULL DEFAULT 0 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_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_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_payment` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付通道', - `price_market` 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_selling` 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 '奖励积分', - `stock_sales` bigint(20) NULL DEFAULT 1 COMMENT '商品数量', + `uid` bigint(20) NULL DEFAULT 0 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_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_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_payment` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '指定支付通道', + `price_market` 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_selling` 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 '商品奖励积分', + `stock_sales` bigint(20) NULL DEFAULT 1 COMMENT '包含商品数量', `vip_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '用户等级名称', `vip_code` bigint(20) NULL DEFAULT 0 COMMENT '用户等级序号', `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 '商品优惠金额', `status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', `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, INDEX `idx_shop_order_item_status`(`status`) 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`; CREATE TABLE `shop_order_send` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, - `uid` bigint(20) NULL DEFAULT 0 COMMENT '用户编号', - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单订单', + `uid` bigint(20) NULL DEFAULT 0 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_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 '配送收货人手机', @@ -611,8 +611,8 @@ CREATE TABLE `shop_order_send` ( `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_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '快递发送时间', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '发货商品状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '发货删除状态(0未删,1已删)', `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_shop_order_send_mid`(`uid`) USING BTREE, diff --git a/app/data/controller/ShopGoods.php b/app/data/controller/ShopGoods.php index dd5929005..3992c99a0 100644 --- a/app/data/controller/ShopGoods.php +++ b/app/data/controller/ShopGoods.php @@ -160,7 +160,7 @@ class ShopGoods extends Controller $this->trucks = ExpressService::instance()->templates(); $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->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'; $data['data_items'] = json_encode($this->app->db->name('ShopGoodsItem')->where(['goods_code' => $data['code']])->column($fields, 'goods_spec'), JSON_UNESCAPED_UNICODE); diff --git a/app/data/controller/UserDiscount.php b/app/data/controller/UserDiscount.php index d3b9a31e2..5ccc8e694 100644 --- a/app/data/controller/UserDiscount.php +++ b/app/data/controller/UserDiscount.php @@ -16,7 +16,7 @@ class UserDiscount extends Controller * 绑定数据表 * @var string */ - private $table = 'DataUserDiscount'; + private $table = 'DataBaseDiscount'; /** * 折扣方案管理 diff --git a/app/data/controller/UserNotify.php b/app/data/controller/UserNotify.php index 13d9313fc..3b00c5c12 100644 --- a/app/data/controller/UserNotify.php +++ b/app/data/controller/UserNotify.php @@ -15,7 +15,7 @@ class UserNotify extends Controller * 绑定数据表 * @var string */ - private $table = 'DataUserNotify'; + private $table = 'DataBaseNotify'; /** * 系统通知管理 diff --git a/app/data/controller/UserUpgrade.php b/app/data/controller/UserUpgrade.php index 319e9f39b..bf9b472e9 100644 --- a/app/data/controller/UserUpgrade.php +++ b/app/data/controller/UserUpgrade.php @@ -16,7 +16,7 @@ class UserUpgrade extends Controller * 绑定数据表 * @var string */ - private $table = 'DataUserUpgrade'; + private $table = 'DataBaseUpgrade'; /** * 用户等级管理 diff --git a/app/data/controller/api/Data.php b/app/data/controller/api/Data.php index c826140d8..c5ecedafb 100644 --- a/app/data/controller/api/Data.php +++ b/app/data/controller/api/Data.php @@ -31,7 +31,7 @@ class Data extends Controller */ 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); $this->success('获取系统通知数据', $result); } diff --git a/app/data/controller/api/auth/Rebate.php b/app/data/controller/api/auth/Rebate.php index 0ea38ead8..5cb5c1422 100644 --- a/app/data/controller/api/auth/Rebate.php +++ b/app/data/controller/api/auth/Rebate.php @@ -44,7 +44,7 @@ class Rebate extends Auth { [$map, $data] = [['number' => $this->user['vip_code']], []]; $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)); foreach (RebateService::PRIZES as $prize) { if (in_array($prize['code'], $codemap)) $data[] = $prize; diff --git a/app/data/service/OrderService.php b/app/data/service/OrderService.php index 755ec97c0..f6c4ba261 100644 --- a/app/data/service/OrderService.php +++ b/app/data/service/OrderService.php @@ -106,7 +106,7 @@ class OrderService extends Service { if ($disId > 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) ?: []; if (is_array($disitems) && count($disitems) > 0) foreach ($disitems as $vo) { if ($vo['level'] == $vipCode) $disRate = floatval($vo['discount']); diff --git a/app/data/service/RebateService.php b/app/data/service/RebateService.php index 5a5024753..708dddaeb 100644 --- a/app/data/service/RebateService.php +++ b/app/data/service/RebateService.php @@ -254,12 +254,12 @@ class RebateService extends Service $puids = array_reverse(str2arr($this->user['path'], '-')); 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(); // 查询需要计算奖励的商品 $map = [['order_no', '=', $this->order['order_no']], ['discount_rate', '<', 100]]; 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))) { [$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) { @@ -295,7 +295,7 @@ class RebateService extends Service // 记录原始等级 $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) { if ($user['vip_code'] > $prevLevel) { 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 { $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; } } \ No newline at end of file diff --git a/app/data/service/UserUpgradeService.php b/app/data/service/UserUpgradeService.php index 0821e2b04..fcac7abbe 100644 --- a/app/data/service/UserUpgradeService.php +++ b/app/data/service/UserUpgradeService.php @@ -18,7 +18,7 @@ class UserUpgradeService extends Service */ 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'); } @@ -44,7 +44,7 @@ class UserUpgradeService extends Service $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(); // 计算用户等级 - 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; $l2 = empty($item['teams_users_status']) || $item['teams_users_number'] <= $teamsUsers; $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'); if ($tmpCode > $vipCode) { $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']]; } else { $orderNo = null; @@ -73,7 +73,7 @@ class UserUpgradeService extends Service $tmpCode = $this->app->db->name('DataUserBalance')->where(['uid' => $uid, 'deleted' => 0])->max('vip_upgrade'); if ($tmpCode > $vipCode) { $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']]; } // 统计用户订单金额