shish 4 жил өмнө
parent
commit
5c50a5c35b

+ 8 - 1
app-mall/controllers/OrderController.php

@@ -246,7 +246,14 @@ class OrderController extends BaseController
         $totalFee = $order['realPrice'];
 
         //小程序使用miniOpenId
-        $openId = $this->user['miniOpenId'];
+        $openId = $this->user['miniOpenId'] ?? '';
+        if (empty($openId)) {
+            $openId = $post['miniOpenId'] ?? '';
+        }
+        if (empty($openId)) {
+            util::fail('没有openId');
+        }
+
         $capitalType = dict::getDict('capitalType', 'xhOrder', 'id');
         //流水类型、优惠卷、微信支付(h5还是小程序支付)类型 带到回调
         $wxPayType = 0;