fly 4 rokov pred
rodič
commit
8b643b9f85

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

@@ -474,7 +474,10 @@ class BookConfigService
      */
     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();
     }
 
     /**