From 4e91d298fd02cb2a6dc899da645b3f5e7304e3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Fri, 19 Mar 2021 15:39:00 +0800 Subject: [PATCH] Update UserTransfer.php --- app/data/command/UserTransfer.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/data/command/UserTransfer.php b/app/data/command/UserTransfer.php index 4b3efc4e8..6535be4a1 100644 --- a/app/data/command/UserTransfer.php +++ b/app/data/command/UserTransfer.php @@ -62,7 +62,7 @@ class UserTransfer extends Command } } } catch (\Exception $exception) { - $this->output->writeln("订单 {$vo['code']} 提现失败,{$exception->getMessage()}"); + $this->output->writeln("提现 {$vo['code']} 失败,{$exception->getMessage()}"); $this->app->db->name('DataUserTransfer')->where(['code' => $vo['code']])->update([ 'change_time' => date('Y-m-d H:i:s'), 'change_desc' => $exception->getMessage(), ]); @@ -228,14 +228,11 @@ class UserTransfer extends Command $local->set($file2, $data['wechat_mch_cert_text'], true); } // 获取用户支付信息 - if (is_array($result = $this->getWechatInfo($uid, $data['wechat_type']))) { - [$appid, $openid] = $result; - } else { - throw new Exception('获取用户打款信息失败'); - } + $result = $this->getWechatInfo($uid, $data['wechat_type']); + if (empty($result)) throw new Exception('无法读取打款数据'); return [ - 'appid' => $appid, - 'openid' => $openid, + 'appid' => $result[0], + 'openid' => $result[1], 'mch_id' => $data['wechat_mch_id'], 'mch_key' => $data['wechat_mch_key'], 'ssl_key' => $local->path($file1),