diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index 1e8f9ac7b..3eb0e3e06 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -433,4 +433,14 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface $newDate = date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . setting_value('visiosoft.module.advs::default_published_time') . ' day')); return $advs->update(['finish_at' => $newDate]); } + + public function getByUsersIDs($usersIDs) + { + return $this + ->newQuery() + ->whereIn('advs_advs.created_by_id', $usersIDs) + ->where('advs_advs.slug', '!=', "") + ->where('advs_advs.status', 'approved') + ->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s')); + } } diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php index 8ee44cdb3..33b95c869 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvRepositoryInterface.php @@ -35,4 +35,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface public function getCategoriesWithAdID($id); public function extendAds($allAds, $isAdmin = false); + + public function getByUsersIDs($usersIDs); }