Browse Source

update onetime package

Tokumeikoi 5 years ago
parent
commit
47d8dfd7c8

+ 1 - 1
app/Console/Commands/CheckOrder.php

@@ -103,7 +103,7 @@ class CheckOrder extends Command
         $user->d = 0;
         $user->plan_id = $plan->id;
         $user->group_id = $plan->group_id;
-        $user->expired_at = 0;
+        $user->expired_at = NULL;
         if ($user->save()) {
             $order->status = 3;
             $order->save();

+ 1 - 1
app/Services/ServerService.php

@@ -12,7 +12,7 @@ class ServerService
             ->whereRaw('u + d < transfer_enable')
             ->where(function ($query) {
                 $query->where('expired_at', '>=', time())
-                    ->orWhere('expired_at', 0);
+                    ->orWhere('expired_at', NULL);
             })
             ->where('enable', 1)
             ->select([

+ 2 - 2
app/Services/UserService.php

@@ -8,7 +8,7 @@ class UserService
 {
     public function isAvailable(User $user)
     {
-        if ($user->enable && $user->transfer_enable && ($user->expired_at > time() || $user->expired_at == 0)) {
+        if ($user->enable && $user->transfer_enable && ($user->expired_at > time() || $user->expired_at === NULL)) {
             return true;
         }
         return false;
@@ -19,7 +19,7 @@ class UserService
         return User::whereRaw('u + d < transfer_enable')
             ->where(function ($query) {
                 $query->where('expired_at', '>=', time())
-                    ->orWhere('expired_at', 0);
+                    ->orWhere('expired_at', NULL);
             })
             ->where('enable', 1)
             ->select([