mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-11 07:46:07 -06:00
fixes
This commit is contained in:
parent
f953f807e4
commit
1835ca681f
@ -71,13 +71,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
|
|
||||||
public function userAdv($nullable_ad = false, $checkRole = true)
|
public function userAdv($nullable_ad = false, $checkRole = true)
|
||||||
{
|
{
|
||||||
if ($user = Auth::user() and $user->hasRole('admin') && $checkRole) {
|
|
||||||
return $this->getAdv(null, $nullable_ad);
|
|
||||||
} else {
|
|
||||||
return $this->getAdv(null, $nullable_ad)
|
return $this->getAdv(null, $nullable_ad)
|
||||||
->where('advs_advs.created_by_id', Auth::id());
|
->where('advs_advs.created_by_id', Auth::id());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function getAdvByCat($cat_id)
|
public function getAdvByCat($cat_id)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,6 +43,8 @@ class OptionConfigurationController extends PublicController
|
|||||||
public function confAddCart()
|
public function confAddCart()
|
||||||
{
|
{
|
||||||
if($conf = $this->optionConfigurationRepository->find($this->request->configuration))
|
if($conf = $this->optionConfigurationRepository->find($this->request->configuration))
|
||||||
|
{
|
||||||
|
if($conf->parent_adv->getStatus() == "approved")
|
||||||
{
|
{
|
||||||
$conf->name = $conf->getName();
|
$conf->name = $conf->getName();
|
||||||
|
|
||||||
@ -54,6 +56,9 @@ class OptionConfigurationController extends PublicController
|
|||||||
return $this->redirect->to(route('visiosoft.module.carts::cart'));
|
return $this->redirect->to(route('visiosoft.module.carts::cart'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$this->messages->info(trans('visiosoft.module.advs::message.error_added_cart'));
|
||||||
|
return back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ajaxConfAddCart()
|
public function ajaxConfAddCart()
|
||||||
|
|||||||
@ -1229,7 +1229,7 @@ class AdvsController extends PublicController
|
|||||||
$thisModel = new AdvModel();
|
$thisModel = new AdvModel();
|
||||||
$adv = $thisModel->isAdv($id);
|
$adv = $thisModel->isAdv($id);
|
||||||
$response = array();
|
$response = array();
|
||||||
if ($adv) {
|
if ($adv and $adv->getStatus() == "approved") {
|
||||||
$cart = $thisModel->addCart($adv, $quantity, $name);
|
$cart = $thisModel->addCart($adv, $quantity, $name);
|
||||||
$response['status'] = "success";
|
$response['status'] = "success";
|
||||||
$count = $cart->getItems()->count;
|
$count = $cart->getItems()->count;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user