From 644188231e09f2714847ecfbf3177a1c03a5fab7 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 18:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=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 | 62 +++++++++---------- .../{ShopPayment.php => BasePayment.php} | 6 +- app/data/controller/ShopGoods.php | 2 +- app/data/controller/api/auth/Order.php | 2 +- app/data/service/PaymentService.php | 2 +- .../{shop_payment => base_payment}/form.html | 6 +- .../form_alipay.html | 0 .../form_joinpay.html | 0 .../form_wechat.html | 0 .../{shop_payment => base_payment}/index.html | 2 +- .../index_search.html | 0 vendor/composer/autoload_classmap.php | 2 +- vendor/composer/autoload_static.php | 2 +- vendor/services.php | 2 +- 14 files changed, 44 insertions(+), 44 deletions(-) rename app/data/controller/{ShopPayment.php => BasePayment.php} (97%) rename app/data/view/{shop_payment => base_payment}/form.html (97%) rename app/data/view/{shop_payment => base_payment}/form_alipay.html (100%) rename app/data/view/{shop_payment => base_payment}/form_joinpay.html (100%) rename app/data/view/{shop_payment => base_payment}/form_wechat.html (100%) rename app/data/view/{shop_payment => base_payment}/index.html (98%) rename app/data/view/{shop_payment => base_payment}/index_search.html (100%) diff --git a/SQL01-数据表结构.sql b/SQL01-数据表结构.sql index 54c442c68..895c8c0a4 100644 --- a/SQL01-数据表结构.sql +++ b/SQL01-数据表结构.sql @@ -11,7 +11,7 @@ Target Server Version : 50562 File Encoding : 65001 - Date: 26/03/2021 17:48:18 + Date: 26/03/2021 18:05:56 */ SET NAMES utf8mb4; @@ -36,10 +36,10 @@ CREATE TABLE `data_base_discount` ( ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据-基础-折扣' ROW_FORMAT = Compact; -- ---------------------------- --- Table structure for data_base_notify +-- Table structure for data_base_message -- ---------------------------- -DROP TABLE IF EXISTS `data_base_notify`; -CREATE TABLE `data_base_notify` ( +DROP TABLE IF EXISTS `data_base_message`; +CREATE TABLE `data_base_message` ( `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 '消息名称', @@ -50,11 +50,34 @@ CREATE TABLE `data_base_notify` ( `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 + INDEX `idx_data_base_message_type`(`type`) USING BTREE, + INDEX `idx_data_base_message_status`(`status`) USING BTREE, + INDEX `idx_data_base_message_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_payment +-- ---------------------------- +DROP TABLE IF EXISTS `data_base_payment`; +CREATE TABLE `data_base_payment` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付类型', + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '通道编号', + `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付名称', + `cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付图标', + `content` 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) 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_payment_type`(`type`) USING BTREE, + INDEX `idx_data_base_payment_code`(`code`) USING BTREE, + INDEX `idx_data_base_payment_status`(`status`) USING BTREE, + 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_upgrade -- ---------------------------- @@ -622,29 +645,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 --- ---------------------------- -DROP TABLE IF EXISTS `shop_payment`; -CREATE TABLE `shop_payment` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付类型', - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '通道编号', - `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付名称', - `cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '支付图标', - `content` 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) 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_shop_payment_type`(`type`) USING BTREE, - INDEX `idx_shop_payment_code`(`code`) USING BTREE, - INDEX `idx_shop_payment_status`(`status`) USING BTREE, - INDEX `idx_shop_payment_deleted`(`deleted`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商城-支付-方式' ROW_FORMAT = COMPACT; - -- ---------------------------- -- Table structure for shop_payment_item -- ---------------------------- @@ -818,7 +818,7 @@ CREATE TABLE `system_oplog` ( `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作人用户名', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 153 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-日志' ROW_FORMAT = COMPACT; +) ENGINE = InnoDB AUTO_INCREMENT = 155 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-日志' ROW_FORMAT = COMPACT; -- ---------------------------- -- Table structure for system_queue diff --git a/app/data/controller/ShopPayment.php b/app/data/controller/BasePayment.php similarity index 97% rename from app/data/controller/ShopPayment.php rename to app/data/controller/BasePayment.php index d7999b6e2..e8208b83c 100644 --- a/app/data/controller/ShopPayment.php +++ b/app/data/controller/BasePayment.php @@ -9,16 +9,16 @@ use think\admin\extend\CodeExtend; /** * 支付参数支付 - * Class ShopPayment + * Class BasePayment * @package app\data\controller */ -class ShopPayment extends Controller +class BasePayment extends Controller { /** * 绑定数据表 * @var string */ - private $table = 'ShopPayment'; + private $table = 'DataBasePayment'; /** * 支付参数类型 diff --git a/app/data/controller/ShopGoods.php b/app/data/controller/ShopGoods.php index 22b321813..808cf7781 100644 --- a/app/data/controller/ShopGoods.php +++ b/app/data/controller/ShopGoods.php @@ -159,7 +159,7 @@ class ShopGoods extends Controller $this->cates = GoodsService::instance()->getCateData(); $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->payments = $this->app->db->name('DataBasePayment')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('type,code,name', 'code'); $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'; diff --git a/app/data/controller/api/auth/Order.php b/app/data/controller/api/auth/Order.php index 448995575..6e1be7281 100644 --- a/app/data/controller/api/auth/Order.php +++ b/app/data/controller/api/auth/Order.php @@ -306,7 +306,7 @@ class Order extends Auth if (empty($payments)) $this->error('获取订单支付参数失败'); [$map, $types] = [['status' => 1, 'deleted' => 0], []]; foreach (PaymentService::TYPES as $type => $arr) if (in_array($this->type, $arr['bind'])) $types[] = $type; - $query = $this->app->db->name('ShopPayment')->where($map)->whereIn('type', $types)->whereIn('code', str2arr($payments)); + $query = $this->app->db->name('DataBasePayment')->where($map)->whereIn('type', $types)->whereIn('code', str2arr($payments)); $this->success('获取支付参数数据', $query->order('sort desc,id desc')->field('type,code,name,cover')->select()->toArray()); } diff --git a/app/data/service/PaymentService.php b/app/data/service/PaymentService.php index f84f91571..1948484af 100644 --- a/app/data/service/PaymentService.php +++ b/app/data/service/PaymentService.php @@ -202,7 +202,7 @@ abstract class PaymentService try { if (empty($payment)) { $map = ['code' => $code, 'status' => 1, 'deleted' => 0]; - $payment = app()->db->name('ShopPayment')->where($map)->find(); + $payment = app()->db->name('DataBasePayment')->where($map)->find(); } if (empty($payment)) { throw new Exception("支付参数[#{$code}]禁用关闭"); diff --git a/app/data/view/shop_payment/form.html b/app/data/view/base_payment/form.html similarity index 97% rename from app/data/view/shop_payment/form.html rename to app/data/view/base_payment/form.html index d86904624..86f916cf1 100644 --- a/app/data/view/shop_payment/form.html +++ b/app/data/view/base_payment/form.html @@ -47,9 +47,9 @@ -
{include file='shop_payment/form_wechat'}
-
{include file='shop_payment/form_alipay'}
-
{include file='shop_payment/form_joinpay'}
+
{include file='base_payment/form_wechat'}
+
{include file='base_payment/form_alipay'}
+
{include file='base_payment/form_joinpay'}
支付描述 diff --git a/app/data/view/shop_payment/form_alipay.html b/app/data/view/base_payment/form_alipay.html similarity index 100% rename from app/data/view/shop_payment/form_alipay.html rename to app/data/view/base_payment/form_alipay.html diff --git a/app/data/view/shop_payment/form_joinpay.html b/app/data/view/base_payment/form_joinpay.html similarity index 100% rename from app/data/view/shop_payment/form_joinpay.html rename to app/data/view/base_payment/form_joinpay.html diff --git a/app/data/view/shop_payment/form_wechat.html b/app/data/view/base_payment/form_wechat.html similarity index 100% rename from app/data/view/shop_payment/form_wechat.html rename to app/data/view/base_payment/form_wechat.html diff --git a/app/data/view/shop_payment/index.html b/app/data/view/base_payment/index.html similarity index 98% rename from app/data/view/shop_payment/index.html rename to app/data/view/base_payment/index.html index 7264f7f26..0152757d4 100644 --- a/app/data/view/shop_payment/index.html +++ b/app/data/view/base_payment/index.html @@ -12,7 +12,7 @@ {block name='content'}
- {include file='shop_payment/index_search'} + {include file='base_payment/index_search'} {notempty name='list'} diff --git a/app/data/view/shop_payment/index_search.html b/app/data/view/base_payment/index_search.html similarity index 100% rename from app/data/view/shop_payment/index_search.html rename to app/data/view/base_payment/index_search.html diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 3496a094d..09020273f 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -206,6 +206,7 @@ return array( 'app\\data\\controller\\BaseConfig' => $baseDir . '/app/data/controller/BaseConfig.php', 'app\\data\\controller\\BaseDiscount' => $baseDir . '/app/data/controller/BaseDiscount.php', 'app\\data\\controller\\BaseMessage' => $baseDir . '/app/data/controller/BaseMessage.php', + 'app\\data\\controller\\BasePayment' => $baseDir . '/app/data/controller/BasePayment.php', 'app\\data\\controller\\BaseUpgrade' => $baseDir . '/app/data/controller/BaseUpgrade.php', 'app\\data\\controller\\NewsItem' => $baseDir . '/app/data/controller/NewsItem.php', 'app\\data\\controller\\NewsMark' => $baseDir . '/app/data/controller/NewsMark.php', @@ -215,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\\ShopPayment' => $baseDir . '/app/data/controller/ShopPayment.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', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index fff3f993d..24a3897bb 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -335,6 +335,7 @@ class ComposerStaticInit6dcb8a18f830adceacf76408fbd14a53 'app\\data\\controller\\BaseConfig' => __DIR__ . '/../..' . '/app/data/controller/BaseConfig.php', 'app\\data\\controller\\BaseDiscount' => __DIR__ . '/../..' . '/app/data/controller/BaseDiscount.php', 'app\\data\\controller\\BaseMessage' => __DIR__ . '/../..' . '/app/data/controller/BaseMessage.php', + 'app\\data\\controller\\BasePayment' => __DIR__ . '/../..' . '/app/data/controller/BasePayment.php', 'app\\data\\controller\\BaseUpgrade' => __DIR__ . '/../..' . '/app/data/controller/BaseUpgrade.php', 'app\\data\\controller\\NewsItem' => __DIR__ . '/../..' . '/app/data/controller/NewsItem.php', 'app\\data\\controller\\NewsMark' => __DIR__ . '/../..' . '/app/data/controller/NewsMark.php', @@ -344,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\\ShopPayment' => __DIR__ . '/../..' . '/app/data/controller/ShopPayment.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', diff --git a/vendor/services.php b/vendor/services.php index 6d9266940..8a4976cbf 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library',