Explorar el Código

调试PayStack

kevin_zhangl hace 3 años
padre
commit
6580f92ce9
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      frontendApi/modules/v1/controllers/UserController.php

+ 8 - 1
frontendApi/modules/v1/controllers/UserController.php

@@ -340,14 +340,21 @@ class UserController extends BaseController {
         // 生成随机码 , 初始化redis
         $userName = Info::generateWebUserName('NG',9);
         $redis = \Yii::$app->redis;
+        $post = \Yii::$app->request->post();
 
         if (\Yii::$app->request->isPost) {
             // 根据支付方式区分逻辑
             $payMethod = \Yii::$app->request->post('payType', '');
 
+            if ($payMethod === 'pay_stack') {
+                $formModel = new ApproachDeclarationLoopForm();
+            } else {
+                unset($post['payType']);
+                $formModel = new DeclarationLoopForm();
+            }
+
             $formModel = ($payMethod === 'pay_stack') ? new ApproachDeclarationLoopForm() : new DeclarationLoopForm();
             $formModel->scenario = 'userDec';
-            $post = \Yii::$app->request->post();
 
             $post['province'] = $post['province'] ? :1;
             $post['city'] = $post['city'] ? :1;