|
|
|
|
|
|
|
|
$dataProviderProducer = new ActiveDataProvider([ |
|
|
$dataProviderProducer = new ActiveDataProvider([ |
|
|
'query' => Producer::find() |
|
|
'query' => Producer::find() |
|
|
->with('userProducer', 'user') |
|
|
->with('userProducer', 'user') |
|
|
->orderBy('date_creation DESC'), |
|
|
|
|
|
|
|
|
->orderBy('free_price DESC'), |
|
|
'pagination' => [ |
|
|
'pagination' => [ |
|
|
'pageSize' => 1000, |
|
|
'pageSize' => 1000, |
|
|
], |
|
|
], |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
$producersArray = Producer::find() |
|
|
|
|
|
->with('userProducer', 'user') |
|
|
|
|
|
->orderBy('free_price DESC') |
|
|
|
|
|
->all(); |
|
|
|
|
|
|
|
|
|
|
|
$sumFreePrice = 0 ; |
|
|
|
|
|
foreach($producersArray as $producer) { |
|
|
|
|
|
$sumFreePrice += $producer->free_price ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return $this->render('index', [ |
|
|
return $this->render('index', [ |
|
|
'dataProviderProducer' => $dataProviderProducer, |
|
|
'dataProviderProducer' => $dataProviderProducer, |
|
|
|
|
|
'sumFreePrice' => $sumFreePrice |
|
|
]); |
|
|
]); |
|
|
} |
|
|
} |
|
|
|
|
|
|