fixed edit category probleb for admin roles

This commit is contained in:
vedatakd 2020-01-02 16:44:36 +03:00
parent 71a4743cf6
commit 8039771dea

View File

@ -72,11 +72,15 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
public function userAdv() public function userAdv()
{ {
if (Auth::user()->hasRole('admin')) {
return $this->getAdv();
} else {
return $this->getAdv() return $this->getAdv()
->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)
{ {
return $this->userAdv() return $this->userAdv()