fly %!s(int64=4) %!d(string=hai) anos
pai
achega
8b643b9f85
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      app/Modules/Book/Services/BookConfigService.php

+ 4 - 1
app/Modules/Book/Services/BookConfigService.php

@@ -474,7 +474,10 @@ class BookConfigService
      */
      */
     public static function findFreeBookConfig(int $sex)
     public static function findFreeBookConfig(int $sex)
     {
     {
-        return FreeBookConfig::where(['sex' => $sex, 'is_enabled' => 1])->orderBy('end_time')->first();
+        return FreeBookConfig::where(['sex' => $sex, 'is_enabled' => 1])
+            ->where('end_time', '>=', now())
+            ->orderBy('end_time')
+            ->first();
     }
     }
 
 
     /**
     /**