Browse Source

再测试

shish 1 year ago
parent
commit
6eaa323904
2 changed files with 33 additions and 33 deletions
  1. 6 6
      app-hd/controllers/OrderController.php
  2. 27 27
      app-hd/controllers/TestController.php

+ 6 - 6
app-hd/controllers/OrderController.php

@@ -320,12 +320,12 @@ class OrderController extends BaseController
         $order = OrderClass::getById($id, true);
         OrderClass::valid($order, $this->mainId);
 
-        if ($order->status == OrderClass::ORDER_STATUS_CANCEL) {
-            util::complete('订单已取消');
-        }
-        if ($order->status != OrderClass::ORDER_STATUS_UN_PAY) {
-            util::complete('订单不是待付款状态');
-        }
+//        if ($order->status == OrderClass::ORDER_STATUS_CANCEL) {
+//            util::complete('订单已取消');
+//        }
+//        if ($order->status != OrderClass::ORDER_STATUS_UN_PAY) {
+//            util::complete('订单不是待付款状态');
+//        }
 
         $shop = $this->shop;
         $sj = $shop->merchantName;

+ 27 - 27
app-hd/controllers/TestController.php

@@ -10,32 +10,32 @@ class TestController extends BaseController
 {
     public function actionTestPayAfter()
     {
-        $get = Yii::$app->request->get();
-        $id = $get['order_id'];
-        $order = OrderClass::getById($id, true);
-        if (empty($order)) {
-            util::fail('没有找到订单');
-        }
-        if ($order->mainId != $this->mainId) {
-            util::fail('不是你的订单');
-        }
-
-        $payWay = 1; // balancePay
-        $connection = Yii::$app->db;
-        $transaction = $connection->beginTransaction();
-        try {
-            $actPrice = $order->actPrice;
-            $order->debtPrice = $actPrice;
-            $order->remainDebtPrice = $actPrice;
-            $order->debt = 1;
-            $order->save();
-            OrderClass::payAfter($order, $payWay);
-            $transaction->commit();
-            util::complete('付款成功');
-        } catch (\Exception $exception) {
-            $transaction->rollBack();
-            Yii::info("付款失败原因:" . $exception->getMessage());
-            util::fail('操作失败');
-        }
+//        $get = Yii::$app->request->get();
+//        $id = $get['order_id'];
+//        $order = OrderClass::getById($id, true);
+//        if (empty($order)) {
+//            util::fail('没有找到订单');
+//        }
+//        if ($order->mainId != $this->mainId) {
+//            util::fail('不是你的订单');
+//        }
+//
+//        $payWay = 1; // balancePay
+//        $connection = Yii::$app->db;
+//        $transaction = $connection->beginTransaction();
+//        try {
+//            $actPrice = $order->actPrice;
+//            $order->debtPrice = $actPrice;
+//            $order->remainDebtPrice = $actPrice;
+//            $order->debt = 1;
+//            $order->save();
+//            OrderClass::payAfter($order, $payWay);
+//            $transaction->commit();
+//            util::complete('付款成功');
+//        } catch (\Exception $exception) {
+//            $transaction->rollBack();
+//            Yii::info("付款失败原因:" . $exception->getMessage());
+//            util::fail('操作失败');
+//        }
     }
 }