diff --git a/app/Console/Commands/SyncWeixinRechargeState.php b/app/Console/Commands/SyncWeixinRechargeState.php index 4465196..14a29ac 100644 --- a/app/Console/Commands/SyncWeixinRechargeState.php +++ b/app/Console/Commands/SyncWeixinRechargeState.php @@ -42,7 +42,7 @@ class SyncWeixinRechargeState extends Command { $threshold = 5; $offset_seconds = 40; //支付发起后多少秒开始轮询 - $due_minutes = 500; //支付发起后第一次开始轮询的时间往后延迟5分钟后不再轮询 + $due_minutes = 30; //支付发起后第一次开始轮询的时间往后延迟5分钟后不再轮询 $last_id = cache("last_sync_weixin_recharge_id", 0); DB::enableQueryLog(); diff --git a/app/Libs/WxMicroPay.class.php b/app/Libs/WxMicroPay.class.php index 3c8960f..a0ae1a2 100644 --- a/app/Libs/WxMicroPay.class.php +++ b/app/Libs/WxMicroPay.class.php @@ -95,6 +95,9 @@ class WxMicroPay extends WxPayCommon public function manualQuery(Recharge $recharge) { $query_result = $this->orderQuery($recharge->serial); + if (!isset($query_result["trade_state"])) { + return false; + } if ($query_result["trade_state"] == "SUCCESS") { if (!$recharge->paid_at) { $transaction_id = $query_result["transaction_id"];