From 2a5d0af7feba2856f65d4fdac853085aad655377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sat, 8 May 2021 15:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data/service/PaymentService.php | 18 +++++++++++------- vendor/composer/InstalledVersions.php | 4 ++-- vendor/composer/installed.php | 4 ++-- vendor/services.php | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/data/service/PaymentService.php b/app/data/service/PaymentService.php index 31d1be410..1b28518d8 100644 --- a/app/data/service/PaymentService.php +++ b/app/data/service/PaymentService.php @@ -232,11 +232,12 @@ abstract class PaymentService /** * 获取支付类型 + * @param array $types 默认返回支付 * @return array */ - public static function getTypeAll(): array + public static function getTypeAll(array $types = []): array { - [$types, $binds] = [[], array_keys(UserAdminService::TYPES)]; + $binds = array_keys(UserAdminService::TYPES); foreach (self::TYPES as $k => $v) if (isset($v['bind'])) { if (array_intersect($v['bind'], $binds)) $types[$k] = $v; } @@ -245,12 +246,12 @@ abstract class PaymentService /** * 筛选可用的支付类型 - * @param string $api + * @param string $api 指定接口类型 + * @param array $types 默认返回支付 * @return array */ - public static function getTypeApi(string $api = ''): array + public static function getTypeApi(string $api = '', array $types = []): array { - $types = []; foreach (self::TYPES as $type => $attr) { if (in_array($api, $attr['bind'])) $types[] = $type; } @@ -292,8 +293,11 @@ abstract class PaymentService protected function createPaymentAction(string $orderNo, string $paymentTitle, string $paymentAmount) { $this->app->db->name('DataUserPayment')->insert([ - 'payment_code' => $this->code, 'payment_type' => $this->type, - 'order_amount' => $paymentAmount, 'order_name' => $paymentTitle, 'order_no' => $orderNo, + 'payment_code' => $this->code, + 'payment_type' => $this->type, + 'order_no' => $orderNo, + 'order_name' => $paymentTitle, + 'order_amount' => $paymentAmount, ]); } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index bd871f984..26bb1ef89 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -32,7 +32,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => '6bcd71f0e4e546ff525c8e84c1c6667cc581acc0', + 'reference' => '2cdefb1932c282dcacd0233e4d356c5c253da870', 'name' => 'zoujingli/thinkadmin', ), 'versions' => @@ -180,7 +180,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => '6bcd71f0e4e546ff525c8e84c1c6667cc581acc0', + 'reference' => '2cdefb1932c282dcacd0233e4d356c5c253da870', ), 'zoujingli/wechat-developer' => array ( diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 151136908..769a28989 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => '6bcd71f0e4e546ff525c8e84c1c6667cc581acc0', + 'reference' => '2cdefb1932c282dcacd0233e4d356c5c253da870', 'name' => 'zoujingli/thinkadmin', ), 'versions' => @@ -154,7 +154,7 @@ 'aliases' => array ( ), - 'reference' => '6bcd71f0e4e546ff525c8e84c1c6667cc581acc0', + 'reference' => '2cdefb1932c282dcacd0233e4d356c5c253da870', ), 'zoujingli/wechat-developer' => array ( diff --git a/vendor/services.php b/vendor/services.php index 7be4e966f..bb5e88567 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library',