mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
added sahibinden check icon and show features for web view && fixed get categories
This commit is contained in:
parent
23d596b78b
commit
36756b046f
@ -47,8 +47,8 @@ class AdvsController extends PublicController
|
||||
private $adv_repository;
|
||||
|
||||
private $optionConfigurationRepository;
|
||||
private $productOptionRepository;
|
||||
private $productOptionsValueRepository;
|
||||
private $productOptionRepository;
|
||||
private $productOptionsValueRepository;
|
||||
|
||||
private $country_repository;
|
||||
|
||||
@ -77,8 +77,8 @@ class AdvsController extends PublicController
|
||||
AdvRepositoryInterface $advRepository,
|
||||
|
||||
OptionConfigurationRepositoryInterface $optionConfigurationRepository,
|
||||
ProductoptionRepositoryInterface $productOptionRepository,
|
||||
ProductoptionsValueRepositoryInterface $productOptionsValueRepository,
|
||||
ProductoptionRepositoryInterface $productOptionRepository,
|
||||
ProductoptionsValueRepositoryInterface $productOptionsValueRepository,
|
||||
|
||||
CountryRepositoryInterface $country_repository,
|
||||
|
||||
@ -110,7 +110,7 @@ class AdvsController extends PublicController
|
||||
|
||||
$this->optionConfigurationRepository = $optionConfigurationRepository;
|
||||
$this->productOptionRepository = $productOptionRepository;
|
||||
$this->productOptionsValueRepository = $productOptionsValueRepository;
|
||||
$this->productOptionsValueRepository = $productOptionsValueRepository;
|
||||
|
||||
$this->country_repository = $country_repository;
|
||||
|
||||
@ -582,15 +582,15 @@ class AdvsController extends PublicController
|
||||
$this->template->set('showTitle', false);
|
||||
$this->template->set('meta_title', $metaTitle);
|
||||
|
||||
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
|
||||
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
|
||||
|
||||
|
||||
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 {
|
||||
return back();
|
||||
}
|
||||
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 {
|
||||
return back();
|
||||
}
|
||||
} else {
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.ad_doesnt_exist'));
|
||||
return redirect()->route('visiosoft.module.advs::list');
|
||||
@ -782,8 +782,14 @@ class AdvsController extends PublicController
|
||||
}
|
||||
}
|
||||
|
||||
$get_categories = in_array($adv->cat1, setting_value('visiosoft.module.advs::get_categories'));
|
||||
$adv->is_get_adv = ($request->is_get_adv and $get_categories) ? true : false;
|
||||
$get_categories_status = false;
|
||||
if ($get_categories = setting_value('visiosoft.module.advs::get_categories') and $get_categories = in_array($adv->cat1, $get_categories)) {
|
||||
$get_categories_status = true;
|
||||
}
|
||||
|
||||
$adv->is_get_adv = ($request->is_get_adv and $get_categories_status) ? true : false;
|
||||
|
||||
|
||||
$adv->save();
|
||||
|
||||
//algolia Search Module
|
||||
@ -803,7 +809,9 @@ class AdvsController extends PublicController
|
||||
$CloudinaryModel = new VideoModel();
|
||||
$CloudinaryModel->updateRequest($request);
|
||||
|
||||
if ($request->url != "") { $adv->save(); }
|
||||
if ($request->url != "") {
|
||||
$adv->save();
|
||||
}
|
||||
}
|
||||
if ($this->adv_model->is_enabled('customfields')) {
|
||||
app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->store($adv, $request);
|
||||
@ -864,7 +872,7 @@ class AdvsController extends PublicController
|
||||
return redirect(route('advs_preview', [$request->update_id]));
|
||||
}
|
||||
|
||||
/* New Create Adv */
|
||||
/* New Create Adv */
|
||||
$request->publish_at = date('Y-m-d H:i:s');
|
||||
$all = $request->all();
|
||||
|
||||
@ -983,13 +991,13 @@ class AdvsController extends PublicController
|
||||
|
||||
$this->adv_model->statusAds($id, $type);
|
||||
event(new ChangedStatusAd($ad));//Create Notify
|
||||
if ($type === 'approved') {
|
||||
$message = trans('visiosoft.module.advs::message.approve_status_change');
|
||||
} elseif ($type === 'sold') {
|
||||
$message = trans('visiosoft.module.advs::message.sold_status_change');
|
||||
} else {
|
||||
trans('visiosoft.module.advs::message.passive_status_change');
|
||||
}
|
||||
if ($type === 'approved') {
|
||||
$message = trans('visiosoft.module.advs::message.approve_status_change');
|
||||
} elseif ($type === 'sold') {
|
||||
$message = trans('visiosoft.module.advs::message.sold_status_change');
|
||||
} else {
|
||||
trans('visiosoft.module.advs::message.passive_status_change');
|
||||
}
|
||||
$this->messages->success($message);
|
||||
return back();
|
||||
}
|
||||
@ -1271,12 +1279,12 @@ class AdvsController extends PublicController
|
||||
return $this->redirect->back();
|
||||
}
|
||||
|
||||
public function sold($id, Request $request, AdvModel $advModel)
|
||||
{
|
||||
if ($request->sold == 'sold') {
|
||||
$advModel->find($id)->update(['status' => 'sold']);
|
||||
} elseif ($request->sold = 'not-sold') {
|
||||
$advModel->find($id)->update(['status' => 'approved']);
|
||||
}
|
||||
}
|
||||
public function sold($id, Request $request, AdvModel $advModel)
|
||||
{
|
||||
if ($request->sold == 'sold') {
|
||||
$advModel->find($id)->update(['status' => 'sold']);
|
||||
} elseif ($request->sold = 'not-sold') {
|
||||
$advModel->find($id)->update(['status' => 'approved']);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user