diff --git a/plugin/think-plugs-wechat/src/service/PaymentService.php b/plugin/think-plugs-wechat/src/service/PaymentService.php index ee6a59860..c9c8ba3bb 100644 --- a/plugin/think-plugs-wechat/src/service/PaymentService.php +++ b/plugin/think-plugs-wechat/src/service/PaymentService.php @@ -82,7 +82,7 @@ class PaymentService if ($oPayed + $pAmount > floatval($oAmount)) { return ['code' => 0, 'info' => '支付总额超出!', 'data' => [], 'params' => []]; } - $config = WechatService::getConfig('', true); + $config = WechatService::getConfig(true); do $pCode = CodeExtend::uniqidNumber(16, 'P'); while (WechatPaymentRecord::mk()->master()->where(['code' => $pCode])->findOrEmpty()->isExists()); $data = [ @@ -328,7 +328,7 @@ class PaymentService */ protected static function withPayment(?array $config = null): Order { - return Order::instance($config ?: WechatService::getConfig('', true)); + return Order::instance($config ?: WechatService::getConfig(true)); } /** diff --git a/plugin/think-plugs-wechat/src/service/WechatService.php b/plugin/think-plugs-wechat/src/service/WechatService.php index b9ac86fc7..77dd6a267 100644 --- a/plugin/think-plugs-wechat/src/service/WechatService.php +++ b/plugin/think-plugs-wechat/src/service/WechatService.php @@ -178,15 +178,14 @@ class WechatService extends Service /** * 获取公众号配置参数 - * @param string $appid 指定公众号 * @param boolean $ispay 获取支付参数 * @return array * @throws \think\admin\Exception */ - public static function getConfig(string $appid = '', bool $ispay = false): array + public static function getConfig(bool $ispay = false): array { $config = [ - 'appid' => $appid ?: static::getAppid(), + 'appid' => static::getAppid(), 'token' => sysconf('wechat.token'), 'appsecret' => sysconf('wechat.appsecret'), 'encodingaeskey' => sysconf('wechat.encodingaeskey'), @@ -197,7 +196,7 @@ class WechatService extends Service /** * 获取小程序配置参数 - * @param boolean $ispay 支付参数 + * @param boolean $ispay 获取支付参数 * @return array * @throws \think\admin\Exception */