Implemented filefix %SCAN/%RESCAN, and some cosmetic cleanup
This commit is contained in:
@@ -84,18 +84,18 @@ class FilefixRescan implements ShouldQueue
|
||||
$earliest = NULL;
|
||||
$latest = NULL;
|
||||
|
||||
foreach (File::select(['id','datetime'])
|
||||
->where('filearea_id',$this->fao->id)
|
||||
->where('datetime','>=',
|
||||
Carbon::now()
|
||||
->subDays($this->days)
|
||||
->startOfDay()
|
||||
)
|
||||
->orderBy('datetime')
|
||||
->cursor() as $fo) {
|
||||
|
||||
foreach (File::select(['id','datetime','name'])
|
||||
->where('filearea_id',$this->fao->id)
|
||||
->where('datetime','>=',
|
||||
Carbon::now()
|
||||
->subDays($this->days)
|
||||
->startOfDay()
|
||||
)
|
||||
->orderBy('datetime')
|
||||
->cursor() as $fo)
|
||||
{
|
||||
// File hasnt been exported before
|
||||
if (! $fo->seenby->count()) {
|
||||
if (! $fo->seenby->where('address_id',$this->ao->id)->count()) {
|
||||
$fo->seenby()->attach($this->ao->id,['export_at'=>Carbon::now()]);
|
||||
$c++;
|
||||
|
||||
@@ -131,7 +131,7 @@ class FilefixRescan implements ShouldQueue
|
||||
|
||||
} else {
|
||||
$s++;
|
||||
Log::debug(sprintf('Not resending previously sent message [%d], FILE (%s) - sent on [%s]',
|
||||
Log::debug(sprintf('Not resending previously sent file [%d], FILE (%s) - sent on [%s]',
|
||||
$fo->id,
|
||||
$fo->name,
|
||||
$export->pivot->sent_at ?: '-',
|
||||
|
Reference in New Issue
Block a user