diff --git a/backend/views/parser/checkPrice.php b/backend/views/parser/checkPrice.php index 719ee82..b1d0749 100644 --- a/backend/views/parser/checkPrice.php +++ b/backend/views/parser/checkPrice.php @@ -21,10 +21,26 @@ $this->params['breadcrumbs'][] = $this->title; [ 'label' =>'Поставщик', 'value' => function ($data) { - return '№ ' . $data->id . $data->name; + return '№ ' .$data->id . ' ' . $data->name; }, ], ['label' =>'Дата обновления', - 'attribute' => 'price_date_update' ]]] );?> + 'attribute' => 'price_date_update' ], + ['label' => 'Кол-во дней', + 'value' => function ($data) { + $date1 = new DateTime("now"); + $date2 = new DateTime( $data->price_date_update ); + $quo_days = $date2->diff($date1)->format('%R%a'); + // уберем первый символ - там знак "+" + $quo_days = substr( $quo_days, 1, strlen($quo_days) ); + $quo_days = (int) $quo_days; + + if($quo_days > 15) + $quo_days = '>15'; + + return $quo_days; + } + ] + ]] );?> \ No newline at end of file -- libgit2 0.21.4