shish 2 lat temu
rodzic
commit
03bb5948dd
1 zmienionych plików z 8 dodań i 1 usunięć
  1. 8 1
      app-hd/controllers/CgRefundController.php

+ 8 - 1
app-hd/controllers/CgRefundController.php

@@ -60,7 +60,6 @@ class CgRefundController extends BaseController
         if (in_array($cg->debt, [0, 2]) && $cg->addTime < '2023-10-17 00:00:00') {
             util::fail('10月17日前订单无法申请退款');
         }
-
         $ghsId = $cg->ghsId ?? 0;
         $ghs = GhsClass::getById($ghsId, true);
         if (empty($ghs)) {
@@ -86,6 +85,14 @@ class CgRefundController extends BaseController
         if (isset($cg->clearId) && !empty($cg->clearId)) {
             util::fail('订单已结,不能再申请售后');
         }
+        $payTime = $cg->payTime;
+        $currentTime = strtotime($payTime);
+        $now = time();
+        $newTime = bcadd($currentTime, 89400);
+        if ($now > $newTime) {
+            util::fail('超时订单,不能自行申请售后');
+        }
+
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {