mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-12 08:16:06 -06:00
This commit is contained in:
parent
1111aefa15
commit
aacd3fa83a
@ -292,7 +292,9 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
->inRandomOrder()
|
||||
->first();
|
||||
|
||||
if ($adv) {
|
||||
$adv = $this->getLocationNames($adv);
|
||||
}
|
||||
|
||||
return $adv;
|
||||
}
|
||||
|
||||
@ -343,17 +343,14 @@ class AdvsController extends PublicController
|
||||
{
|
||||
$id = is_null($id) ? $seo : $id;
|
||||
|
||||
$categories = array();
|
||||
$categories_id = array();
|
||||
$isActiveComplaints = $this->adv_model->is_enabled('complaints');
|
||||
$isCommentActive = $this->adv_model->is_enabled('comments');
|
||||
$adv = $this->adv_repository->getListItemAdv($id);
|
||||
|
||||
if ($isActiveComplaints) {
|
||||
if ($adv) {
|
||||
|
||||
if ($this->adv_model->is_enabled('complaints')) {
|
||||
$complaints = ComplaintsComplainTypesEntryModel::all();
|
||||
}
|
||||
|
||||
$adv = $this->adv_repository->getListItemAdv($id);
|
||||
|
||||
$recommended_advs = $this->adv_repository->getRecommendedAds($adv->id);
|
||||
|
||||
foreach ($recommended_advs as $index => $ad) {
|
||||
@ -361,6 +358,8 @@ class AdvsController extends PublicController
|
||||
$recommended_advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
|
||||
}
|
||||
|
||||
$categories = array();
|
||||
$categories_id = array();
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$cat = "cat" . $i;
|
||||
if ($adv->$cat != null) {
|
||||
@ -382,8 +381,7 @@ class AdvsController extends PublicController
|
||||
|
||||
//Cloudinary Module
|
||||
$adv->video_url = null;
|
||||
$isActiveCloudinary = $this->adv_model->is_enabled('cloudinary');
|
||||
if ($isActiveCloudinary) {
|
||||
if ($this->adv_model->is_enabled('cloudinary')) {
|
||||
|
||||
$CloudinaryModel = new VideoModel();
|
||||
$Cloudinary = $CloudinaryModel->getVideo($id);
|
||||
@ -395,7 +393,7 @@ class AdvsController extends PublicController
|
||||
|
||||
$options = $this->optionRepository->findAllBy('adv_id', $id);
|
||||
|
||||
if ($isCommentActive) {
|
||||
if ($this->adv_model->is_enabled('comments')) {
|
||||
$CommentModel = new CommentModel();
|
||||
$comments = $CommentModel->getComments($adv->id)->get();
|
||||
}
|
||||
@ -425,7 +423,10 @@ class AdvsController extends PublicController
|
||||
} else {
|
||||
return back();
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.ad_doesnt_exist'));
|
||||
return redirect()->route('visiosoft.module.advs::list');
|
||||
}
|
||||
}
|
||||
|
||||
public function preview($id)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user