Browse code

Include today's slots ind reservation models findAllFuture method

Benjamin Roth authored on04/09/2023 16:21:29
Showing1 changed files
... ...
@@ -26,7 +26,8 @@ class WeinanlieferungReservationModel extends Model
26 26
     public static function findAllFuture(array $arrOptions=array())
27 27
     {
28 28
         $t = static::$strTable;
29
-        $time = Date::floorToMinute();
29
+        $Date = new Date();
30
+        $time = $Date->dayBegin;
30 31
 
31 32
         return static::findBy(array("pid IN (SELECT tl_vr_wa_slot.id FROM tl_vr_wa_slot WHERE tl_vr_wa_slot.id=tl_vr_wa_reservation.pid AND tl_vr_wa_slot.time >= ?)"), $time, $arrOptions);
32 33
     }
Browse code

Update

Benjamin Roth authored on17/08/2023 00:07:19
Showing1 changed files
... ...
@@ -12,6 +12,7 @@ declare(strict_types=1);
12 12
 
13 13
 namespace vonRotenberg\WeinanlieferungBundle\Model;
14 14
 
15
+use Contao\Date;
15 16
 use Contao\Model;
16 17
 
17 18
 class WeinanlieferungReservationModel extends Model
... ...
@@ -21,4 +22,12 @@ class WeinanlieferungReservationModel extends Model
21 22
      * @var string
22 23
      */
23 24
     protected static $strTable = 'tl_vr_wa_reservation';
25
+
26
+    public static function findAllFuture(array $arrOptions=array())
27
+    {
28
+        $t = static::$strTable;
29
+        $time = Date::floorToMinute();
30
+
31
+        return static::findBy(array("pid IN (SELECT tl_vr_wa_slot.id FROM tl_vr_wa_slot WHERE tl_vr_wa_slot.id=tl_vr_wa_reservation.pid AND tl_vr_wa_slot.time >= ?)"), $time, $arrOptions);
32
+    }
24 33
 }
Browse code

Update

Benjamin Roth authored on09/08/2023 01:02:13
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,24 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
+
5
+/*
6
+ * This file is part of contao-weinanlieferung-bundle.
7
+ *
8
+ * (c) vonRotenberg
9
+ *
10
+ * @license commercial
11
+ */
12
+
13
+namespace vonRotenberg\WeinanlieferungBundle\Model;
14
+
15
+use Contao\Model;
16
+
17
+class WeinanlieferungReservationModel extends Model
18
+{
19
+    /**
20
+     * Table name
21
+     * @var string
22
+     */
23
+    protected static $strTable = 'tl_vr_wa_reservation';
24
+}