mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -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)
|
||||
{
|
||||
$id = $object->id;
|
||||
$seo = str_slug($object->slug, '-');
|
||||
if ($type != null) {
|
||||
$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]);
|
||||
}
|
||||
|
||||
|
||||
@ -581,10 +581,7 @@ class AdvsController extends PublicController
|
||||
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
|
||||
|
||||
|
||||
if (Str::slug($adv->slug, '-') != $seo) {
|
||||
$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") {
|
||||
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',
|
||||
'recommended_advs', 'categories', 'features', 'options', 'configurations'));
|
||||
} else {
|
||||
@ -801,11 +798,7 @@ class AdvsController extends PublicController
|
||||
$CloudinaryModel = new VideoModel();
|
||||
$CloudinaryModel->updateRequest($request);
|
||||
|
||||
if ($request->url != "") {
|
||||
$adv->cover_photo = "https://res.cloudinary.com/" . $request->cloudName . "/video/upload/w_400,e_loop/" .
|
||||
$request->uploadKey . "/" . $request->filename . "gif";
|
||||
$adv->save();
|
||||
}
|
||||
if ($request->url != "") { $adv->save(); }
|
||||
}
|
||||
if ($this->adv_model->is_enabled('customfields')) {
|
||||
app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->store($adv, $request);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user