bid developments

This commit is contained in:
vedatakd 2021-05-10 13:02:06 +03:00
parent e7a6d6ae8f
commit 9290c9951f
6 changed files with 165 additions and 37 deletions

View File

@ -455,4 +455,11 @@ return [
'default_value' => false,
]
],
'show_finish_and_publish_date' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
],
],
];

View File

@ -27,7 +27,7 @@ return [
'favicon' => [
'name' => 'Favicon',
]
,'map_coordinates_long' => [
, 'map_coordinates_long' => [
'name' => 'Map Long Coordinate',
],
'map_coordinates_lat' => [
@ -41,7 +41,7 @@ return [
],
'ogImage' => [
'name' => 'Social Share Logo',
'warning' => 'It should be at a resolution of 1200 x 630. ',
'warning' => 'It should be at a resolution of 1200 x 630. ',
],
'currencies' => [
@ -52,7 +52,7 @@ return [
],
'site_address' => [
'name' => 'Site address',
'warning' => 'Auto added www. www.<strong>sitename.com</strong> ',
'warning' => 'Auto added www. www.<strong>sitename.com</strong> ',
],
'google_map_key' => [
'name' => 'Google Map Api Key',
@ -134,9 +134,9 @@ return [
'market_place' => [
'name' => 'Market Place',
],
'price_area_hidden' => [
'name' => 'Price Area Hidden',
],
'price_area_hidden' => [
'name' => 'Price Area Hidden',
],
'hide_price_filter' => [
'name' => 'Hide Price Filter',
],
@ -215,18 +215,18 @@ return [
'name' => 'Hide Created Date',
'instructions' => 'Hide created date in ads detail page',
],
'hide_listing_header' => [
'name' => 'Hide Listing Header',
'instructions' => 'Hiding to ordering and view types',
],
'hide_filter_section' => [
'name' => 'Hide Filter Section',
'instructions' => 'Hiding to left filter area in listing page',
],
'hide_seller_info' => [
'name' => 'Hide Seller Information',
'instructions' => 'Hiding to seller infos in ads detail page',
],
'hide_listing_header' => [
'name' => 'Hide Listing Header',
'instructions' => 'Hiding to ordering and view types',
],
'hide_filter_section' => [
'name' => 'Hide Filter Section',
'instructions' => 'Hiding to left filter area in listing page',
],
'hide_seller_info' => [
'name' => 'Hide Seller Information',
'instructions' => 'Hiding to seller infos in ads detail page',
],
'show_post_ad_agreement' => [
'name' => 'Show Post Ad Agreement',
'instructions' => 'Turn this on if you want to display a privacy policy agreement on the ad creation page',
@ -251,9 +251,9 @@ return [
'name' => 'GET Categories',
'instructions' => 'It represents the categories in which the GET property will be valid.'
],
'disable_sentry' => [
'name' => 'Disable Sentry'
],
'disable_sentry' => [
'name' => 'Disable Sentry'
],
'watermark' => [
'name' => 'Watermark',
'instructions' => 'Is watermark active?'
@ -265,11 +265,15 @@ return [
'show_subcats_mobile' => [
'name' => 'Show subcategories on mobile view',
],
'show_price_to_members_only' => [
'name' => 'Show Price To Members Only',
],
'hide_ad_cat' => [
'name' => 'Hide Categories',
'instructions' => 'Hide categories in ads list'
]
'show_price_to_members_only' => [
'name' => 'Show Price To Members Only',
],
'hide_ad_cat' => [
'name' => 'Hide Categories',
'instructions' => 'Hide categories in ads list'
],
'show_finish_and_publish_date' => [
'name' => 'Show Finish Date And Publish Date For Create',
'instructions' => 'Displays the publish_at and finish_at fields on the ad creation page.'
],
];

View File

@ -135,6 +135,95 @@
</div>
</div>
<div class="row mx-0 my-3">
<div class="col-6 px-0">
<label>
{{ form.fields.publish_at.label|raw }}
<span class="required">*</span>
</label>
<div class="py-2 pr-3">
{{ form.fields.publish_at.input|raw }}
</div>
</div>
<div class="col-6 px-0">
<label>
{{ form.fields.finish_at.label|raw }}
<span class="required">*</span>
</label>
<div class="py-2 pr-2">
{{ form.fields.finish_at.input|raw }}
</div>
</div>
<style>
.input-group {
position: relative;
width: 100%;
display: flex;
}
.input-group .form-control {
position: relative;
z-index: 2;
flex: 1;
margin-bottom: 0;
}
.input-group .form-control:focus, .input-group .form-control:active, .input-group .form-control:hover {
z-index: 3;
}
.input-group-addon:not(:first-child):not(:last-child),
.input-group-btn:not(:first-child):not(:last-child),
.input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.input-group-addon,
.input-group-btn {
white-space: nowrap;
vertical-align: middle;
}
.input-group-addon {
padding: 0.5rem 0.75rem;
margin-bottom: 0;
font-size: 1rem;
font-weight: normal;
line-height: 1.25;
color: #55595c;
text-align: center;
background-color: #eceeef;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0.1rem;
}
.input-group-addon.form-control-sm,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .input-group-addon.btn {
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
border-radius: 0.1rem;
}
.input-group-addon.form-control-lg,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .input-group-addon.btn {
padding: 0.75rem 1.5rem;
font-size: 1.25rem;
border-radius: 0.25rem;
}
.input-group-addon input[type=radio],
.input-group-addon input[type=checkbox] {
margin-top: 0;
}
</style>
</div>
{% if not setting_value('visiosoft.module.advs::hide_options_field') %}
{% if not setting_value('visiosoft.module.advs::detailed_product_options') %}
<div id="simpleOptionsInput" class="w-100 select-options">

View File

@ -27,7 +27,7 @@ class AdvFormBuilder extends FormBuilder
{
$requiredFields = setting_value('visiosoft.module.advs::make_all_fields_required');
return [
$fields = [
'name' => [
'translatable' => true,
'required' => true,
@ -84,5 +84,18 @@ class AdvFormBuilder extends FormBuilder
'adv_day',
'product_options_value'
];
if (setting_value('visiosoft.module.advs::show_finish_and_publish_date')) {
$fields = array_merge($fields, [
'finish_at' => [
'required' => true,
],
'publish_at' => [
'required' => true,
],
]);
}
return $fields;
}
}

View File

@ -17,11 +17,18 @@ class Approve extends ActionHandler
if ($ad = $model->newQuery()->find($id)) {
$ad->update([
$update = [
'status' => 'approved',
'finish_at' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $defaultAdPublishTime . ' day')),
'publish_at' => date('Y-m-d H:i:s')
]);
];
if (!setting_value('visiosoft.module.advs::show_finish_and_publish_date')) {
$update = array_merge($update, [
'finish_at' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $defaultAdPublishTime . ' day')),
'publish_at' => date('Y-m-d H:i:s')
]);
}
$ad->update($update);
event(new ChangedStatusAd($ad));//Create Notify
}

View File

@ -844,11 +844,19 @@ class AdvsController extends PublicController
if (setting_value('visiosoft.module.advs::auto_approve') && $autoApprove) {
$defaultAdPublishTime = setting_value('visiosoft.module.advs::default_published_time');
$adv->update([
$update = [
'status' => 'approved',
'finish_at' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $defaultAdPublishTime . ' day')),
'publish_at' => date('Y-m-d H:i:s')
]);
];
if (!setting_value('visiosoft.module.advs::show_finish_and_publish_date')) {
$update = array_merge($update, [
'finish_at' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . ' + ' . $defaultAdPublishTime . ' day')),
'publish_at' => date('Y-m-d H:i:s')
]);
}
$adv->update($update);
}
$form->render($this->request->update_id);