diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php index 1206b5420..2b73fceed 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvModel.php @@ -387,15 +387,24 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface if ($cFs = (array) json_decode($this->cf_json)) { $cFs = array_keys($cFs); + $cFIDs = array_map(function ($cF) { + return ltrim($cF, 'cf'); + }, $cFs); + return app(CustomFieldRepositoryInterface::class) ->newQuery() - ->whereIn('id', $cFs) + ->whereIn('id', $cFIDs) ->get(); } return []; } + public function cFJSON() + { + return (array) json_decode($this->cf_json); + } + // 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..105da9504 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Contract/AdvInterface.php @@ -60,6 +60,8 @@ interface AdvInterface extends EntryInterface public function customfields(); + public function cFJSON(); + public function priceFormat($adv); public function AddAdsDefaultCoverImage($ad);