From 6729204f817e9d6103702a394ba1e45f894d90cd Mon Sep 17 00:00:00 2001 From: BrettonYe <867057410@qq.com> Date: Mon, 30 Jan 2023 23:42:19 +0800 Subject: [PATCH] Fixed F2F error & aff salt bug --- app/Components/Helpers.php | 2 +- app/Payments/F2Fpay.php | 2 +- app/Services/UserService.php | 2 +- app/helpers.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Components/Helpers.php b/app/Components/Helpers.php index fa70b78c..61ee1797 100644 --- a/app/Components/Helpers.php +++ b/app/Components/Helpers.php @@ -266,7 +266,7 @@ class Helpers public static function getPriceTag($amount): string { $currentCurrency = session('currency'); - $standard = sysConfig('standard_currency'); + $standard = sysConfig('standard_currency', 'CNY'); $currencyLib = array_column(config('common.currency'), 'symbol', 'code'); if (! empty($currentCurrency) && isset($currencyLib[$currentCurrency]) && $currentCurrency !== $standard) { return $currencyLib[$currentCurrency].CurrencyExchange::convert($currentCurrency, $amount); diff --git a/app/Payments/F2Fpay.php b/app/Payments/F2Fpay.php index fb1881e0..faef812d 100644 --- a/app/Payments/F2Fpay.php +++ b/app/Payments/F2Fpay.php @@ -57,7 +57,7 @@ class F2Fpay extends Gateway exit; } - if ($result['code'] === 10000 && $result['msg'] === 'Success') { + if ($result['code'] === '10000' && $result['msg'] === 'Success') { if ($request->has('out_trade_no') && in_array($request->input('trade_status'), ['TRADE_FINISHED', 'TRADE_SUCCESS'])) { if ($this->paymentReceived($request->input('out_trade_no'))) { exit('success'); diff --git a/app/Services/UserService.php b/app/Services/UserService.php index f532b14c..07548dd9 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -52,7 +52,7 @@ class UserService extends BaseService { $affSalt = sysConfig('aff_salt'); if (isset($affSalt)) { - $aff = (new Hashids($affSalt, 8))->encode(self::$user->id()); + $aff = (new Hashids($affSalt, 8))->encode(self::$user->id); } else { $aff = self::$user->id; } diff --git a/app/helpers.php b/app/helpers.php index 071aeb9d..1addedec 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -88,7 +88,7 @@ if (! function_exists('filterEmoji')) { // 获取系统设置 if (! function_exists('sysConfig')) { - function sysConfig($key = false, $default = null) + function sysConfig(string $key = null, string $default = null) { return $key ? config('settings.'.$key, $default) : config('settings'); }