public function renderItem($book)
{
//какой-то код...
$title = $book->title();
$author = $book->author()[0]['first-name'].' '.$book->author()[0]['last-name'];
//какой-то код...
}
renderItem($item->book)
$query = Model::find()
->where(['between', 'datatime_column', '2018-05-01', '2018-05-20']);
public function getLogs()
{
return $this->hasMany(Log::className(), ['order_id' => 'id']);
}
$query->joinWith(['logs'])
//фильтры
//$query->filterWhere(какой-то фильтр)
//...
//после всех фильтров
$query->orderBy([Log::tablename().'.date'=>SORT_DESC])->limit(1);