From 9110db48e5a83a9438149241b712382f53b7e9f7 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 22 Jan 2020 13:14:49 +0300 Subject: [PATCH 1/3] #246 --- .../visiosoft/advs-module/src/Adv/AdvRepository.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index f3ef4674e..a54f6a251 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -190,15 +190,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface if ($isActiveDopings) { - if ($param == null) { - $DopingModel = new DopingModel(); - $doping_advs_ids = $DopingModel->getFeaturedAds(3); - $query = $query->whereIn('advs_advs.id', $doping_advs_ids); - } - $query = $query->leftJoin('dopings_dopings', function ($join) { - $join->on('advs_advs.id', '=', 'dopings_dopings.adv_name_id'); - $join->where('dopings_dopings.doping_type_id', '=', 4); - }); + $query = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->search($query, $param); } if (!empty($param['sort_by'])) { switch ($param['sort_by']) { @@ -215,8 +207,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface } else { $query = $query->orderBy('advs_advs.created_at', 'desc'); if ($isActiveDopings) { - $query = $query->select('advs_advs.*', 'advs_advs_translations.name as name', - 'advs_advs_translations.advs_desc as advs_desc', 'dopings_dopings.id as doping'); + $query = app('Visiosoft\DopingsModule\Http\Controller\DopingsController')->querySelect($query); } else { $query = $query->select('advs_advs.*', 'advs_advs_translations.name as name', 'advs_advs_translations.advs_desc as advs_desc'); From 2a7034016ab1523e8c21b11859575ad9b0ecd850 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 22 Jan 2020 16:03:46 +0300 Subject: [PATCH 2/3] price format --- ..._211014_visiosoft.module.advs__create_advs_fields.php | 4 +++- .../visiosoft/advs-module/resources/config/settings.php | 9 --------- .../resources/views/ad-detail/partials/detail.twig | 3 +-- .../advs-module/resources/views/list/partials/ads.twig | 2 +- .../advs-module/resources/views/list/table.twig | 2 +- .../advs-module/src/Http/Controller/advsController.php | 1 + composer.json | 2 ++ 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/addons/default/visiosoft/advs-module/migrations/2018_09_25_211014_visiosoft.module.advs__create_advs_fields.php b/addons/default/visiosoft/advs-module/migrations/2018_09_25_211014_visiosoft.module.advs__create_advs_fields.php index fa29c6dc9..523a35a7b 100644 --- a/addons/default/visiosoft/advs-module/migrations/2018_09_25_211014_visiosoft.module.advs__create_advs_fields.php +++ b/addons/default/visiosoft/advs-module/migrations/2018_09_25_211014_visiosoft.module.advs__create_advs_fields.php @@ -112,7 +112,9 @@ class VisiosoftModuleAdvsCreateAdvsFields extends Migration ] ], 'order' => 'anomaly.field_type.integer', - 'price' => 'anomaly.field_type.decimal', + 'price' => [ + 'type' => 'visiosoft.field_type.decimal', + ], 'currency' => [ 'type' => 'anomaly.field_type.select', 'config' => [ diff --git a/addons/default/visiosoft/advs-module/resources/config/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings.php index f5cec3fa1..49440ad18 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings.php @@ -151,15 +151,6 @@ return [ 'mode' => 'upload', ] ], - 'currencies' => [ - "type" => "anomaly.field_type.checkboxes", - 'bind' => 'adv.currencies', - 'env' => 'ADV_CURRENCIES', - 'config' => [ - "default_value" => 'a:1:{i:0;s:1:"0";}', - 'options' => Config::get('streams::currencies.enabled') - ] - ], 'free_currencyconverterapi_key' => [ "type" => "anomaly.field_type.text", 'bind' => 'adv.free_currencyconverterapi_key', diff --git a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig index ce50acfb9..583a104ac 100644 --- a/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig +++ b/addons/default/visiosoft/advs-module/resources/views/ad-detail/partials/detail.twig @@ -2,8 +2,7 @@ {% if blocks('ad-item-details-block-area') is null %}

- {{ currency_symbol(adv.currency) }}{{ adv.price.format() }} - + {{ adv.price.currency(null,'currency',false) }} {{ addBlock('ad-detail/priceField',{'adv':adv})|raw }} diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig index bba008d20..f7a1232bd 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/ads.twig @@ -20,7 +20,7 @@
- {{ adv.price.currency }} + {{ adv.price.currency(null,'currency',false) }}
{% if setting_value('visiosoft.module.location::list_page_location') %}
diff --git a/addons/default/visiosoft/advs-module/resources/views/list/table.twig b/addons/default/visiosoft/advs-module/resources/views/list/table.twig index d969f529c..e90cb7f34 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/table.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/table.twig @@ -36,7 +36,7 @@
- {{ adv.price.currency }} + {{ adv.price.currency(null,'currency',false) }} {{ adv.created_at|date("d/m/Y") }} diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index c92588e45..1e7337400 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -163,6 +163,7 @@ class AdvsController extends PublicController foreach ($featured_advs as $index => $ad) { $featured_advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list'); + $featured_advs[$index]->price = number_format($ad->price); $featured_advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad); } diff --git a/composer.json b/composer.json index 509c5675a..2f0d114b4 100644 --- a/composer.json +++ b/composer.json @@ -67,6 +67,8 @@ "anomaly/html_block-extension": "~1.0.0", "anomaly/wysiwyg_block-extension": "~1.0.0", "ammadeuss/laravel-html-dom-parser": "^1.1", + "visiosoft/decimal-field_type": "~2.1.0", + "visiosoft/integer-field_type": "~2.1.0", "guzzlehttp/guzzle": "~6.3.3" }, "require-dev": { From 2998fd4ca6e95292c85a8c1883ef58f67c188693 Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 22 Jan 2020 16:22:46 +0300 Subject: [PATCH 3/3] fixed location country --- .../location-module/resources/js/filterLocation.js | 2 +- .../resources/views/ads-list/partials/location-fields.twig | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/default/visiosoft/location-module/resources/js/filterLocation.js b/addons/default/visiosoft/location-module/resources/js/filterLocation.js index 589909e7b..a012e7a83 100644 --- a/addons/default/visiosoft/location-module/resources/js/filterLocation.js +++ b/addons/default/visiosoft/location-module/resources/js/filterLocation.js @@ -198,7 +198,7 @@ function SelectOnClick() { var id = $(this).attr('data-id'); if ($(this).attr('data-field') == "country") { - input.val(id) + $('input[name="country"]').val(id) text_html.html(input_text) $(".filter-location-body input[type='checkbox']").prop('checked', false); $(".filter-location-body li[data-id='" + id + "'] input[type='checkbox']").prop('checked', true); diff --git a/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig b/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig index 60561af34..7156b88a7 100644 --- a/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig +++ b/addons/default/visiosoft/location-module/resources/views/ads-list/partials/location-fields.twig @@ -3,13 +3,13 @@ {{ trans('visiosoft.module.location::field.address.name') }} - - {{ getCountry(setting_value('visiosoft.module.location::default_country')).name }} - {% set country = setting_value('visiosoft.module.location::default_country') %} {% if app.request.get('country') %} {% set country = app.request.get('country') %} {% endif %} + + {{ getCountry(country).name }} +