mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#3189 emlak24 bugs
This commit is contained in:
parent
4b30b2a41c
commit
cb0152bfd2
@ -1,6 +1,7 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv;
|
||||
|
||||
use Anomaly\Streams\Platform\Entry\EntryCollection;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
@ -26,4 +27,13 @@ class AdvCollection extends EntryCollection
|
||||
'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
|
||||
->newQuery()
|
||||
->whereIn('advs_advs.created_by_id', $usersIDs)
|
||||
->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s'));
|
||||
->whereIn('advs_advs.created_by_id', $usersIDs);
|
||||
|
||||
if ($status) {
|
||||
$ads = $ads->where('advs_advs.status', 'approved');
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user