shish 2 лет назад
Родитель
Сommit
32f6ebdcf3
1 измененных файлов с 24 добавлено и 13 удалено
  1. 24 13
      app-ghs/controllers/TestController.php

+ 24 - 13
app-ghs/controllers/TestController.php

@@ -26,20 +26,31 @@ class TestController extends BaseController
     {
         $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
         $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
-        $params = [
-            'appid' => 'OP00002119',
-            'serial_no' => '018b08cfddbd',
-            'merchant_no' => '82239305992006L',
-            'term_no' => 'C6337694',
-            'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
-            'lklCertificatePath' => $lklCertificatePath,
-        ];
-        $data = [
-            'subMerchantId' => '2088820709029782',
+
+
+        $arr = [
+            ['name' => '国兰花尚', 'merchantNo' => '82239305992006L', 'wx' => [600913569, 600907053], 'zfb' => '2088820709029782']
         ];
-        $laResource = new Lakala($params);
-        $response = $laResource->openStateQuery($data);
-        print_r($response);
+        foreach ($arr as $item) {
+            $wx = $item['wx'];
+            $merchantNo = $item['merchantNo'];
+            foreach ($wx as $oneWx) {
+                $params = [
+                    'appid' => 'OP00002119',
+                    'serial_no' => '018b08cfddbd',
+                    'merchant_no' => $merchantNo,
+                    'term_no' => 'C6337694',
+                    'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
+                    'lklCertificatePath' => $lklCertificatePath,
+                ];
+                $data = [
+                    'subMerchantId' => $oneWx,
+                ];
+                $laResource = new Lakala($params);
+                $response = $laResource->openStateQuery($data);
+                print_r($response);die;
+            }
+        }
     }
 
     public function actionAliRun2()