Commit 387be185c4480b3baf6df13b99e561930ed30761

Authored by Mihail
1 parent 3b7211a0

add all needs column into price change view

Showing 1 changed file with 18 additions and 2 deletions   Show diff stats
backend/views/parser/checkPrice.php
... ... @@ -21,10 +21,26 @@ $this->params['breadcrumbs'][] = $this->title;
21 21 [
22 22 'label' =>'Поставщик',
23 23 'value' => function ($data) {
24   - return '№ ' . $data->id . $data->name;
  24 + return '№ ' .$data->id . ' ' . $data->name;
25 25 },
26 26 ],
27 27 ['label' =>'Дата обновления',
28   - 'attribute' => 'price_date_update' ]]] );?>
  28 + 'attribute' => 'price_date_update' ],
  29 + ['label' => 'Кол-во дней',
  30 + 'value' => function ($data) {
  31 + $date1 = new DateTime("now");
  32 + $date2 = new DateTime( $data->price_date_update );
  33 + $quo_days = $date2->diff($date1)->format('%R%a');
  34 + // уберем первый символ - там знак "+"
  35 + $quo_days = substr( $quo_days, 1, strlen($quo_days) );
  36 + $quo_days = (int) $quo_days;
  37 +
  38 + if($quo_days > 15)
  39 + $quo_days = '>15';
  40 +
  41 + return $quo_days;
  42 + }
  43 + ]
  44 + ]] );?>
29 45  
30 46 </div>
31 47 \ No newline at end of file
... ...