Browse Source

fix(payment): 修复支付宝支付订单状态更新问题

- 更新store_group_order表时同时设置hf_pay_id和pay_type字段
- 为store_order表添加pay_type字段更新以确保支付类型同步
- 解决了支付宝支付流程中订单支付类型的缺失问题
shichen 3 months ago
parent
commit
1c46766a30
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/controller/api/AliPay.php

+ 4 - 2
app/controller/api/AliPay.php

@@ -31,8 +31,10 @@ class AliPay
31 31
         }
32 32
         $access = new Access();
33 33
         $res = $access->pay_huifu('ALI','',$groupOrder,'支付宝支付',env('APP_URL')."/api/hf_notify/pay");
34
-        // 更新store_group_order表hf_pay_id
35
-        StoreGroupOrder::update(['hf_pay_id'=>$res['id']],['group_order_id'=>$groupOrderId]);
34
+        // 更新store_group_order表hf_pay_id,pay_type
35
+        StoreGroupOrder::update(['hf_pay_id' => $res['id'], 'pay_type' => 4], ['group_order_id' => $groupOrderId]);
36
+        // 更新store_order表pay_type
37
+        StoreGroupOrder::update(['pay_type' => 4], ['group_order_id' => $groupOrderId]);
36 38
         return app('json')->success($res);
37 39
     }
38 40