Завел значение времени для кампаний

parent 38bef421
...@@ -457,6 +457,11 @@ input.group-title { ...@@ -457,6 +457,11 @@ input.group-title {
width: 110px; width: 110px;
} }
.form-control.date-value.datetime
{
width: 150px;
}
.form-control.price, .form-control.price,
.form-control.order-sum .form-control.order-sum
{ {
......
...@@ -206,6 +206,10 @@ class CabinetAmSystem extends Common ...@@ -206,6 +206,10 @@ class CabinetAmSystem extends Common
$date_end_common = null; $date_end_common = null;
} }
} }
$date_begin = date("Y-m-d", strtotime($date_begin));
$date_end = date("Y-m-d", strtotime($date_end));
if ($date_end_common) { if ($date_end_common) {
$date_end_common = $date_end; $date_end_common = $date_end;
} }
...@@ -352,9 +356,9 @@ class CabinetAmSystem extends Common ...@@ -352,9 +356,9 @@ class CabinetAmSystem extends Common
} }
} }
$date_begin = $campaign->getDateBegin(); $date_begin = date("Y-m-d", strtotime($campaign->getDateBegin()));
$date_end_common = $campaign->getDateEnd() ? : null; $date_end_common = $campaign->getDateEnd() ? (date("Y-m-d", strtotime($campaign->getDateEnd()))): null;
$date_end = $campaign->getDateEnd() ? : date("Y-m-d"); $date_end = $campaign->getDateEnd() ? date("Y-m-d", strtotime($campaign->getDateEnd())) : date("Y-m-d");
$dates_common = [$date_begin, $date_end_common]; $dates_common = [$date_begin, $date_end_common];
$dates = [$date_begin, $date_end]; $dates = [$date_begin, $date_end];
$campaign_stat = $stats->getCampaignsStat('campaign', [(int)$campaign_id], $campaign->getTargetAction(), $dates_common, true); $campaign_stat = $stats->getCampaignsStat('campaign', [(int)$campaign_id], $campaign->getTargetAction(), $dates_common, true);
...@@ -412,6 +416,7 @@ class CabinetAmSystem extends Common ...@@ -412,6 +416,7 @@ class CabinetAmSystem extends Common
$data['code_regions'] = $this->getCodeRegions(); $data['code_regions'] = $this->getCodeRegions();
$data['code_cities'] = $this->getCodeCities(); $data['code_cities'] = $this->getCodeCities();
$data['img_domain'] = (getenv('DEVELOPMENT')) ? self::IMG_DOMAIN_DEV : self::IMG_DOMAIN_PROD; $data['img_domain'] = (getenv('DEVELOPMENT')) ? self::IMG_DOMAIN_DEV : self::IMG_DOMAIN_PROD;
$data['dates_common'] = $dates_common;
} else { } else {
$data['error'] = _t('Извините, данная кампания закреплена за другим пользователем'); $data['error'] = _t('Извините, данная кампания закреплена за другим пользователем');
......
...@@ -60,8 +60,9 @@ if (!$error) { ...@@ -60,8 +60,9 @@ if (!$error) {
$campaign_id = $campaign->getId(); $campaign_id = $campaign->getId();
$campaign_title = $campaign->getTitle(); $campaign_title = $campaign->getTitle();
$campaign_url = $campaign->getUrl(); $campaign_url = $campaign->getUrl();
$campaign_date_begin = $campaign->getDateBegin(); $campaign_date_begin = date('Y-m-d H:i', strtotime($campaign->getDateBegin()));
$campaign_date_end = $campaign->getDateEnd(); $campaign_date_end = date('Y-m-d H:i', strtotime($campaign->getDateEnd()));
$dates_common = $this->dates_common;
$campaign_buy_type = $group->getBuyType(); $campaign_buy_type = $group->getBuyType();
$campaign_target_action = $group->getTargetAction(); $campaign_target_action = $group->getTargetAction();
$campaign_price = ($campaign->getPrice()) ? $campaign->getPrice()/10 : null; $campaign_price = ($campaign->getPrice()) ? $campaign->getPrice()/10 : null;
...@@ -172,9 +173,9 @@ if (!$error) { ...@@ -172,9 +173,9 @@ if (!$error) {
<div class="form-group"> <div class="form-group">
<label class="title-field"><?= _t('Даты проведения')?></label> <label class="title-field"><?= _t('Даты проведения')?></label>
c: c:
<input type='text' id="campaign-date-begin" class="form-control date-value" name="date_begin" value="<?= $campaign_date_begin ?>" autocomplete="off" /> <input type='text' id="campaign-date-begin" class="form-control date-value datetime" name="date_begin" value="<?= $campaign_date_begin ?>" autocomplete="off" />
по: по:
<input type='text' id="campaign-date-end" class="form-control date-value" name="date_end" value="<?= $campaign_date_end ?>" autocomplete="off" /> <input type='text' id="campaign-date-end" class="form-control date-value datetime" name="date_end" value="<?= $campaign_date_end ?>" autocomplete="off" />
</div> </div>
<!-- Ссылка --> <!-- Ссылка -->
...@@ -620,9 +621,9 @@ if (!$error) { ...@@ -620,9 +621,9 @@ if (!$error) {
<div class="form-group"> <div class="form-group">
<label for="campaign-date-begin"><?= _t('Дата')?></label> <label for="campaign-date-begin"><?= _t('Дата')?></label>
c: c:
<input type='text' id="campaign-date-begin-common" class="campaign-date-begin form-control date-value" name="date_begin" value="<?= $campaign_date_begin ?>" autocomplete="off" /> <input type='text' id="campaign-date-begin-common" class="campaign-date-begin form-control date-value" name="date_begin" value="<?= $dates_common[0] ?>" autocomplete="off" />
по: по:
<input type='text' id="campaign-date-end-common" class="campaign-date-end form-control date-value" name="date_end" value="<?= $campaign_date_end ?>" autocomplete="off" /> <input type='text' id="campaign-date-end-common" class="campaign-date-end form-control date-value" name="date_end" value="<?= $dates_common[1] ?>" autocomplete="off" />
</div> </div>
<div class="chart-graph-stat-info"> <div class="chart-graph-stat-info">
...@@ -669,9 +670,9 @@ if (!$error) { ...@@ -669,9 +670,9 @@ if (!$error) {
<div class="form-group"> <div class="form-group">
<label for="campaign-date-begin"><?= _t('Дата')?></label> <label for="campaign-date-begin"><?= _t('Дата')?></label>
c: c:
<input type='text' id="campaign-date-begin-sites" class="campaign-date-begin form-control date-value" name="date_begin" value="<?= $campaign_date_begin ?>" autocomplete="off" /> <input type='text' id="campaign-date-begin-sites" class="campaign-date-begin form-control date-value" name="date_begin" value="<?= $dates_common[0] ?>" autocomplete="off" />
по: по:
<input type='text' id="campaign-date-end-sites" class="campaign-date-end form-control date-value" name="date_end" value="<?= $campaign_date_end ?>" autocomplete="off" /> <input type='text' id="campaign-date-end-sites" class="campaign-date-end form-control date-value" name="date_end" value="<?= $dates_common[1] ?>" autocomplete="off" />
</div> </div>
<div class="sites-stats"> <div class="sites-stats">
...@@ -716,9 +717,9 @@ if (!$error) { ...@@ -716,9 +717,9 @@ if (!$error) {
<div class="form-group"> <div class="form-group">
<label for="campaign-date-begin"><?= _t('Дата')?></label> <label for="campaign-date-begin"><?= _t('Дата')?></label>
c: c:
<input type='text' id="campaign-date-begin-regions" class="campaign-date-begin form-control date-value" name="date_begin" value="<?= $campaign_date_begin ?>" autocomplete="off" /> <input type='text' id="campaign-date-begin-regions" class="campaign-date-begin form-control date-value" name="date_begin" value="<?= $dates_common[0] ?>" autocomplete="off" />
по: по:
<input type='text' id="campaign-date-end-regions" class="campaign-date-end form-control date-value" name="date_end" value="<?= $campaign_date_end ?>" autocomplete="off" /> <input type='text' id="campaign-date-end-regions" class="campaign-date-end form-control date-value" name="date_end" value="<?= $dates_common[1] ?>" autocomplete="off" />
</div> </div>
<div class="regions-stats"> <div class="regions-stats">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment