Ver código fonte

售后申请限制

shish 1 ano atrás
pai
commit
cf836bd758
1 arquivos alterados com 8 adições e 21 exclusões
  1. 8 21
      app-hd/controllers/CgRefundController.php

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

@@ -89,27 +89,14 @@ class CgRefundController extends BaseController
         $payTime = $cg->payTime;
         $currentTime = strtotime($payTime);
         $now = time();
-        //限制12小时内可以主动申请售后
-        $changeTime = 43200;
-        if ($ghsShop->pfLevel && $ghsShop->pfLevel == 1) {
-            //昆明批发商售后时间调整为3天
-            $changeTime = bcmul(3, 86400);
-        }
-        if($ghsShopId == 26578){
-            //九江云朵48小时内可以自主售后
-            $changeTime = bcmul(2, 86400);
-        }
-        if($ghsShopId == 7831){
-            //勇记48小时内可以自主售后
-            $changeTime = bcmul(2, 86400);
-        }
-        if($ghsShopId == 21486){
-            //联玉24小时内可以自主售后
-            $changeTime = bcmul(1, 86400);
-        }
-        $newTime = bcadd($currentTime, $changeTime);
-        if ($now > $newTime) {
-            util::fail('超时订单,请联系门店售后');
+        $saleHour = $ghsShop->saleHour;
+        $saleHour = ceil($saleHour);
+        if ($saleHour > 0) {
+            $changeTime = $saleHour * 3600;
+            $newTime = bcadd($currentTime, $changeTime);
+            if ($now > $newTime) {
+                util::fail('超时订单,请联系门店售后');
+            }
         }
 
         $connection = Yii::$app->db;