同步代码

This commit is contained in:
邹景立 2021-05-08 15:50:33 +08:00
parent 2cdefb1932
commit 2a5d0af7fe
4 changed files with 16 additions and 12 deletions

View File

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

View File

@ -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 (

View File

@ -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 (

2
vendor/services.php vendored
View File

@ -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',