shish %!s(int64=2) %!d(string=hai) anos
pai
achega
dac2fb5e5b
Modificáronse 1 ficheiros con 16 adicións e 4 borrados
  1. 16 4
      biz-ghs/order/classes/OrderClearClass.php

+ 16 - 4
biz-ghs/order/classes/OrderClearClass.php

@@ -54,11 +54,23 @@ class OrderClearClass extends BaseClass
             $remainDebtPrice = $order->remainDebtPrice ?? 0;
             $remainDebtPrice = $order->remainDebtPrice ?? 0;
             $currentTotal = bcadd($totalAmount, $remainDebtPrice, 2);
             $currentTotal = bcadd($totalAmount, $remainDebtPrice, 2);
             if ($currentTotal > $customBalance) {
             if ($currentTotal > $customBalance) {
-                continue;
-            } else {
-                $totalAmount = bcadd($totalAmount, $remainDebtPrice, 2);
-                $need[] = ['id' => $orderId];
+                if (getenv('YII_ENV') == 'production') {
+                    //小向需要先结旧账
+                    if (in_array($shop->mainId, [23390])) {
+                        break;
+                    } else {
+                        continue;
+                    }
+                } else {
+                    if (in_array($shop->mainId, [644])) {
+                        break;
+                    } else {
+                        continue;
+                    }
+                }
             }
             }
+            $totalAmount = bcadd($totalAmount, $remainDebtPrice, 2);
+            $need[] = ['id' => $orderId];
         }
         }
         if (empty($need)) {
         if (empty($need)) {
             return true;
             return true;