diff --git a/SQL01-数据表结构.sql b/SQL01-数据表结构.sql index 895c8c0a4..03f7d1138 100644 --- a/SQL01-数据表结构.sql +++ b/SQL01-数据表结构.sql @@ -11,7 +11,7 @@ Target Server Version : 50562 File Encoding : 65001 - Date: 26/03/2021 18:05:56 + Date: 26/03/2021 18:10:56 */ SET NAMES utf8mb4; @@ -78,6 +78,30 @@ CREATE TABLE `data_base_payment` ( INDEX `idx_data_base_payment_deleted`(`deleted`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-基础-支付' ROW_FORMAT = COMPACT; +-- ---------------------------- +-- Table structure for data_base_payment_record +-- ---------------------------- +DROP TABLE IF EXISTS `data_base_payment_record`; +CREATE TABLE `data_base_payment_record` ( + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单单号', + `order_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单描述', + `order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额', + `payment_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付编号', + `payment_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付通道', + `payment_trade` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付单号', + `payment_status` tinyint(1) NULL DEFAULT 0 COMMENT '支付状态', + `payment_amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '支付金额', + `payment_datatime` datetime NULL DEFAULT NULL COMMENT '支付时间', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_data_base_payment_record_order_no`(`order_no`) USING BTREE, + INDEX `idx_data_base_payment_record_payment_code`(`payment_code`) USING BTREE, + INDEX `idx_data_base_payment_record_payment_type`(`payment_type`) USING BTREE, + INDEX `idx_data_base_payment_record_payment_trade`(`payment_trade`) USING BTREE, + INDEX `idx_data_base_payment_record_payment_status`(`payment_status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-基础-支付' ROW_FORMAT = COMPACT; + -- ---------------------------- -- Table structure for data_base_upgrade -- ---------------------------- @@ -645,30 +669,6 @@ CREATE TABLE `shop_order_send` ( INDEX `idx_shop_order_send_order_no`(`order_no`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-订单-配送' ROW_FORMAT = COMPACT; --- ---------------------------- --- Table structure for shop_payment_item --- ---------------------------- -DROP TABLE IF EXISTS `shop_payment_item`; -CREATE TABLE `shop_payment_item` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单单号', - `order_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '订单描述', - `order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额', - `payment_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付编号', - `payment_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付通道', - `payment_trade` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付单号', - `payment_status` tinyint(1) NULL DEFAULT 0 COMMENT '支付状态', - `payment_amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '支付金额', - `payment_datatime` datetime NULL DEFAULT NULL COMMENT '支付时间', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_payment_item_order_no`(`order_no`) USING BTREE, - INDEX `idx_shop_payment_item_payment_code`(`payment_code`) USING BTREE, - INDEX `idx_shop_payment_item_payment_type`(`payment_type`) USING BTREE, - INDEX `idx_shop_payment_item_payment_trade`(`payment_trade`) USING BTREE, - INDEX `idx_shop_payment_item_payment_status`(`payment_status`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-支付-记录' ROW_FORMAT = COMPACT; - -- ---------------------------- -- Table structure for shop_truck_company -- ---------------------------- diff --git a/app/data/controller/ShopPaymentItem.php b/app/data/controller/ShopPaymentItem.php deleted file mode 100644 index 0ce90e420..000000000 --- a/app/data/controller/ShopPaymentItem.php +++ /dev/null @@ -1,35 +0,0 @@ -title = '支付行为记录'; - $query = $this->_query($this->table); - $query->like('order_no')->order('id desc')->page(); - } - -} \ No newline at end of file diff --git a/app/data/service/PaymentService.php b/app/data/service/PaymentService.php index 1948484af..c9374e41d 100644 --- a/app/data/service/PaymentService.php +++ b/app/data/service/PaymentService.php @@ -279,7 +279,7 @@ abstract class PaymentService */ protected function createPaymentAction(string $orderNo, string $paymentTitle, string $paymentAmount) { - $this->app->db->name('ShopPaymentItem')->insert([ + $this->app->db->name('DataBasePaymentRecord')->insert([ 'payment_code' => $this->code, 'payment_type' => $this->type, 'order_amount' => $paymentAmount, 'order_name' => $paymentTitle, 'order_no' => $orderNo, ]); @@ -299,7 +299,7 @@ abstract class PaymentService protected function updatePaymentAction(string $orderNo, string $paymentTrade, string $paymentAmount, string $paymentRemark = '在线支付'): bool { // 更新支付记录 - data_save('ShopPaymentItem', [ + data_save('DataBasePaymentRecord', [ 'order_no' => $orderNo, 'payment_code' => $this->code, 'payment_type' => $this->type, diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index b146e317d..12c0e798a 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -46,6 +46,6 @@ class Index extends Controller $this->_query('ShopOrder')->empty(); $this->_query('ShopOrderItem')->empty(); $this->_query('ShopOrderSend')->empty(); - $this->_query('ShopPaymentItem')->empty(); + $this->_query('DataBasePaymentRecord')->empty(); } } \ No newline at end of file diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 09020273f..9e18ea842 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -216,7 +216,6 @@ return array( 'app\\data\\controller\\ShopOrder' => $baseDir . '/app/data/controller/ShopOrder.php', 'app\\data\\controller\\ShopOrderSend' => $baseDir . '/app/data/controller/ShopOrderSend.php', 'app\\data\\controller\\ShopOrderService' => $baseDir . '/app/data/controller/ShopOrderService.php', - 'app\\data\\controller\\ShopPaymentItem' => $baseDir . '/app/data/controller/ShopPaymentItem.php', 'app\\data\\controller\\ShopTruckCompany' => $baseDir . '/app/data/controller/ShopTruckCompany.php', 'app\\data\\controller\\ShopTruckTemplate' => $baseDir . '/app/data/controller/ShopTruckTemplate.php', 'app\\data\\controller\\User' => $baseDir . '/app/data/controller/User.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 24a3897bb..c6972bff2 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -345,7 +345,6 @@ class ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53 'app\\data\\controller\\ShopOrder' => __DIR__ . '/../..' . '/app/data/controller/ShopOrder.php', 'app\\data\\controller\\ShopOrderSend' => __DIR__ . '/../..' . '/app/data/controller/ShopOrderSend.php', 'app\\data\\controller\\ShopOrderService' => __DIR__ . '/../..' . '/app/data/controller/ShopOrderService.php', - 'app\\data\\controller\\ShopPaymentItem' => __DIR__ . '/../..' . '/app/data/controller/ShopPaymentItem.php', 'app\\data\\controller\\ShopTruckCompany' => __DIR__ . '/../..' . '/app/data/controller/ShopTruckCompany.php', 'app\\data\\controller\\ShopTruckTemplate' => __DIR__ . '/../..' . '/app/data/controller/ShopTruckTemplate.php', 'app\\data\\controller\\User' => __DIR__ . '/../..' . '/app/data/controller/User.php', diff --git a/vendor/services.php b/vendor/services.php index 8a4976cbf..06b18d07b 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library',