Browse Source

模拟接口

shish 11 months ago
parent
commit
dd2311fb31
1 changed files with 12 additions and 7 deletions
  1. 12 7
      app-hd/controllers/IntraCityController.php

+ 12 - 7
app-hd/controllers/IntraCityController.php

@@ -794,13 +794,18 @@ class IntraCityController extends BaseController
     //模拟接口回调 ssh 20250826
     public function actionMockNotify()
     {
-        $post = Yii::$app->request->post();
-        $orderStatus = $post['orderStatus'] ?? 0;
-        $wxOrderId = $post['wxOrderId'] ?? '';
-        $ptStyle = dict::getDict('ptStyle', 'hd');
-        $merchant = WxOpenClass::getWxInfo();
-        $ret = IntraCityExpress::mockNotify($orderStatus, $wxOrderId, '', '', $merchant, $ptStyle);
-        print_r($ret);
+        if (getenv('YII_ENV') != 'production') {
+            if ($this->useSandbox) {
+                $post = Yii::$app->request->post();
+                $orderStatus = $post['orderStatus'] ?? 0;
+                $wxOrderId = $post['wxOrderId'] ?? '';
+                $ptStyle = dict::getDict('ptStyle', 'hd');
+                $merchant = WxOpenClass::getWxInfo();
+                $ret = IntraCityExpress::mockNotify($orderStatus, $wxOrderId, '', '', $merchant, $ptStyle);
+                util::success($ret);
+            }
+        }
+        util::complete();
     }
 
 }