mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-06 05:16:05 -06:00
Merge branch 'master' of https://github.com/openclassify/openclassify
This commit is contained in:
commit
3b5fb8ffb4
@ -216,8 +216,15 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
|
|
||||||
public function getAdvDetailLinkByModel($object, $type = null)
|
public function getAdvDetailLinkByModel($object, $type = null)
|
||||||
{
|
{
|
||||||
$id = $object->id;
|
if ($type != null) {
|
||||||
$seo = str_slug($object->slug, '-');
|
$id = $object->id;
|
||||||
|
$seo = str_slug($object->name);
|
||||||
|
$seo = str_replace('_', '-', $seo);
|
||||||
|
return \route('adv_detail_seo', [$seo, $id]);
|
||||||
|
}
|
||||||
|
$id = $object->getObject()->id;
|
||||||
|
$seo = str_slug($object->getObject()->name);
|
||||||
|
$seo = str_replace('_', '-', $seo);
|
||||||
return \route('adv_detail_seo', [$seo, $id]);
|
return \route('adv_detail_seo', [$seo, $id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -581,10 +581,7 @@ class AdvsController extends PublicController
|
|||||||
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
|
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
|
||||||
|
|
||||||
|
|
||||||
if (Str::slug($adv->slug, '-') != $seo) {
|
if ($adv->created_by_id == isset(auth()->user()->id) or $adv->status == "approved") {
|
||||||
$this->messages->error(trans('visiosoft.module.advs::message.ad_doesnt_exist'));
|
|
||||||
return redirect()->route('visiosoft.module.advs::list');
|
|
||||||
} else if ($adv->created_by_id == isset(auth()->user()->id) or $adv->status == "approved") {
|
|
||||||
return $this->view->make('visiosoft.module.advs::ad-detail/detail', compact('adv', 'complaints',
|
return $this->view->make('visiosoft.module.advs::ad-detail/detail', compact('adv', 'complaints',
|
||||||
'recommended_advs', 'categories', 'features', 'options', 'configurations'));
|
'recommended_advs', 'categories', 'features', 'options', 'configurations'));
|
||||||
} else {
|
} else {
|
||||||
@ -801,11 +798,7 @@ class AdvsController extends PublicController
|
|||||||
$CloudinaryModel = new VideoModel();
|
$CloudinaryModel = new VideoModel();
|
||||||
$CloudinaryModel->updateRequest($request);
|
$CloudinaryModel->updateRequest($request);
|
||||||
|
|
||||||
if ($request->url != "") {
|
if ($request->url != "") { $adv->save(); }
|
||||||
$adv->cover_photo = "https://res.cloudinary.com/" . $request->cloudName . "/video/upload/w_400,e_loop/" .
|
|
||||||
$request->uploadKey . "/" . $request->filename . "gif";
|
|
||||||
$adv->save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($this->adv_model->is_enabled('customfields')) {
|
if ($this->adv_model->is_enabled('customfields')) {
|
||||||
app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->store($adv, $request);
|
app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->store($adv, $request);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user