mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Reimplemented a routine that creates reminders. Cannot act on them yet.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php namespace FireflyIII\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
@@ -10,6 +12,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Reminder extends Model
|
||||
{
|
||||
|
||||
|
||||
protected $fillable = ['user_id', 'startdate', 'enddate', 'active', 'notnow', 'remindersable_id', 'remindersable_type',];
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -26,6 +31,17 @@ class Reminder extends Model
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EloquentBuilder $query
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeOnDates(EloquentBuilder $query, Carbon $start, Carbon $end)
|
||||
{
|
||||
return $query->where('reminders.startdate', '=', $start->format('Y-m-d 00:00:00'))->where('reminders.enddate', '=', $end->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user