#2278 Emlak24 Bugs 10.5.20

This commit is contained in:
Diatrex 2020-10-07 11:02:19 +03:00
parent 592be415fe
commit 4e5bc7cd4a
3 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@
use Anomaly\Streams\Platform\Image\Command\MakeImageInstance;
use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel;
use Carbon\Carbon;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
@ -371,4 +372,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
$neighborhood = $neighborhoodModel->newQuery()->find($this->neighborhood);
return $neighborhood ? $neighborhood->name : false;
}
public function expired()
{
return $this->finish_at ? $this->finish_at < Carbon::now() : true;
}
}

View File

@ -4,4 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
interface AdvInterface extends EntryInterface
{
public function expired();
}

View File

@ -433,7 +433,7 @@ class AdvsController extends PublicController
$adv = $this->adv_repository->getListItemAdv($id);
if ($adv) {
if ($adv && !$adv->expired()) {
if ($this->adv_model->is_enabled('complaints')) {
$complaints = ComplaintsComplainTypesEntryModel::all();