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