From aad685d79533afacfbc06d6c51ceb452455252fa Mon Sep 17 00:00:00 2001 From: diashalabi Date: Sun, 10 Oct 2021 16:21:23 +0300 Subject: [PATCH] #654 [customfields] Improvments --- .../visiosoft/advs-module/src/Adv/AdvModel.php | 5 ----- .../advs-module/src/Adv/Contract/AdvInterface.php | 2 -- .../src/Http/Controller/Admin/AdvsController.php | 12 ------------ 3 files changed, 19 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index faf106f2f..aed892ffc 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -381,11 +381,6 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface } } - public function customfields() - { - return $this->hasMany('Visiosoft\CustomfieldsModule\CustomFieldAdv\CustomFieldAdvModel', 'parent_adv_id', 'id'); - } - // public function getCustomFieldEditId($id) { // $custom_field = AdvsCustomFieldsEntryModel::query()->where('advs_custom_fields.id', $id)->first(); // return DB::table('streams_assignments')->where('field_id', $custom_field->field_id)->first(); diff --git a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php index 693d69980..5370ca5a8 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php @@ -58,8 +58,6 @@ interface AdvInterface extends EntryInterface public function saveCustomField($category_id, $field_id, $name); - public function customfields(); - public function priceFormat($adv); public function AddAdsDefaultCoverImage($ad); diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php index 139a74034..3f0bec60f 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/Admin/AdvsController.php @@ -128,18 +128,6 @@ class AdvsController extends AdminController $newAdvOption->save(); } - // Replicate ad custom fields - $advCustomFields = $this->model->is_enabled('customfields'); - if ($advCustomFields) { - $advCustomFields = app('Visiosoft\CustomfieldsModule\CustomFieldAdv\Contract\CustomFieldAdvRepositoryInterface') - ->newQuery()->where('parent_adv_id', $advID)->get(); - foreach ($advCustomFields as $advCustomField) { - $newaAdvCustomField = $advCustomField->replicate(); - $newaAdvCustomField->parent_adv_id = $newAdv->id; - $newaAdvCustomField->save(); - } - } - $this->messages->success(trans('visiosoft.module.advs::message.replicated_success')); }