root 5 years ago
parent
commit
0de055a36b
1 changed files with 6 additions and 3 deletions
  1. 6 3
      app/Console/Commands/SendRemindMail.php

+ 6 - 3
app/Console/Commands/SendRemindMail.php

@@ -60,11 +60,14 @@ class SendRemindMail extends Command
     }
 
     private function remindTraffic ($user) {
-        if ((($user->u + $user->d) / $user->transfer_enable * 100) >= 80) {
+        function isWarnValue ($ud, $transfer_enable) {
+            if ($ud <= 0) return false;
+            if (($ud / $transfer_enable * 100) < 80) return false;
+            return true;
+        }
+        if (isWarnValue()) {
             
         }
     }
 
-
-
 }