邹景立 3 سال پیش
والد
کامیت
2a5d0af7fe
4فایلهای تغییر یافته به همراه16 افزوده شده و 12 حذف شده
  1. 11 7
      app/data/service/PaymentService.php
  2. 2 2
      vendor/composer/InstalledVersions.php
  3. 2 2
      vendor/composer/installed.php
  4. 1 1
      vendor/services.php

+ 11 - 7
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,
         ]);
     }
 

+ 2 - 2
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 (

+ 2 - 2
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 (

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?php 
-// This file is automatically generated at:2021-05-08 14:09:03
+// This file is automatically generated at:2021-05-08 15:50:24
 declare (strict_types = 1);
 return array (
   0 => 'think\\admin\\Library',