mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
#3189 emlak24 bugs
This commit is contained in:
parent
4b30b2a41c
commit
cb0152bfd2
@ -1,6 +1,7 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Adv;
|
<?php namespace Visiosoft\AdvsModule\Adv;
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Entry\EntryCollection;
|
use Anomaly\Streams\Platform\Entry\EntryCollection;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Container\Container;
|
use Illuminate\Container\Container;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
use Illuminate\Pagination\Paginator;
|
use Illuminate\Pagination\Paginator;
|
||||||
@ -26,4 +27,13 @@ class AdvCollection extends EntryCollection
|
|||||||
'items', 'total', 'perPage', 'currentPage', 'options'
|
'items', 'total', 'perPage', 'currentPage', 'options'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function nonExpired()
|
||||||
|
{
|
||||||
|
return $this->filter(
|
||||||
|
function ($ad) {
|
||||||
|
return $ad->finish_at->gt(Carbon::now());
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -475,15 +475,16 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
{
|
{
|
||||||
$ads = $this
|
$ads = $this
|
||||||
->newQuery()
|
->newQuery()
|
||||||
->whereIn('advs_advs.created_by_id', $usersIDs)
|
->whereIn('advs_advs.created_by_id', $usersIDs);
|
||||||
->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s'));
|
|
||||||
|
|
||||||
if ($status) {
|
if ($status) {
|
||||||
$ads = $ads->where('advs_advs.status', 'approved');
|
$ads = $ads->where('advs_advs.status', 'approved');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$withDraft) {
|
if (!$withDraft) {
|
||||||
$ads = $ads->where('advs_advs.slug', '!=', "");
|
$ads = $ads
|
||||||
|
->where('advs_advs.slug', '!=', "")
|
||||||
|
->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ads;
|
return $ads;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user