mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
added repo currenctAds
This commit is contained in:
parent
256f52c5ac
commit
a659c6c015
@ -539,4 +539,11 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
return $query->where('finish_at', '>', date('Y-m-d H:i:s'))
|
||||
->get();
|
||||
}
|
||||
|
||||
public function currentAds() {
|
||||
return $this->newQuery()->whereDate('finish_at', '>=', date("Y-m-d H:i:s"))
|
||||
->where('status', '=', 'approved')
|
||||
->where('slug', '!=', '')
|
||||
->orderBy('publish_at', 'desc');
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,4 +54,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
|
||||
public function approveAds($adsIDs);
|
||||
|
||||
public function getUserAds($userID = null, $status = "approved");
|
||||
|
||||
public function currentAds();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user