From d9dbfb3ca6315b80d8429cab65ace43fef686a1f Mon Sep 17 00:00:00 2001 From: xl Date: Mon, 3 Jun 2024 11:58:53 +0800 Subject: [PATCH] eee --- wx/V3/WxV3PaymentNotify.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wx/V3/WxV3PaymentNotify.php b/wx/V3/WxV3PaymentNotify.php index 8c3ee5f..e339ab9 100644 --- a/wx/V3/WxV3PaymentNotify.php +++ b/wx/V3/WxV3PaymentNotify.php @@ -142,6 +142,9 @@ class WxV3PaymentNotify extends SmallProgram $this->notifyModel->attach = $data['attach']; $this->notifyModel->success_time = $data['success_time']; $this->notifyModel->promotion_detail = []; + if (!isset($data['promotion_detail'])) { + return true; + } foreach ($data['promotion_detail'] as $datum) { $detail = new PromotionDetail(); $detail->amount = $datum['amount']; @@ -154,8 +157,10 @@ class WxV3PaymentNotify extends SmallProgram $detail->currency = $datum['currency']; $detail->stock_id = $datum['stock_id']; $detail->goods_detail = []; - foreach ($datum['goods_detail'] as $value) { - $detail->goods_detail[] = new GoodsDetail($value); + if (isset($data['goods_detail'])) { + foreach ($datum['goods_detail'] as $value) { + $detail->goods_detail[] = new GoodsDetail($value); + } } $this->notifyModel->promotion_detail[] = $detail; }