From bb150fabb46970e503f9acbb5def9a71ba2db7f2 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Mon, 21 Jun 2021 12:30:09 +0300 Subject: [PATCH] category relation --- .../visiosoft/advs-module/src/Adv/AdvModel.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index 189e30026..8fd62f983 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -21,8 +21,8 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface protected $appends = [ 'detail_url', 'currency_price', - 'cat1_name', - 'cat2_name', + 'category1', + 'category2', 'thumbnail', ]; @@ -36,15 +36,15 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface return app(Currency::class)->format($this->price, $this->currency); } - public function getCat1NameAttribute() + public function getCategory1Attribute() { - return $this->hasMany('Visiosoft\CatsModule\Category\CategoryModel', 'id', 'cat1')->first()->name; + return $this->hasMany('Visiosoft\CatsModule\Category\CategoryModel', 'id', 'cat1')->first(); } - public function getCat2NameAttribute() + public function getCategory2Attribute() { - return $this->hasMany('Visiosoft\CatsModule\Category\CategoryModel', 'id', 'cat1')->first()->name; + return $this->hasMany('Visiosoft\CatsModule\Category\CategoryModel', 'id', 'cat1')->first(); }