Merge pull request #1115 from openclassify/vedatakdogan

added repo currenctAds
This commit is contained in:
Muammer Top 2021-07-12 17:18:16 +03:00 committed by GitHub
commit c4641fe50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -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');
}
}

View File

@ -54,4 +54,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
public function approveAds($adsIDs);
public function getUserAds($userID = null, $status = "approved");
public function currentAds();
}