Array To Activedataprovider

Hi all,

how to change from array to activedataprovider:




$connection = \Yii::$app->db;

$ratingQuery = $connection->createCommand('SELECT vorname, nachname, (

                                          '.$radius.' * SQRT(2*(1-cos(RADIANS(lat)) * 

                                          cos('.$lat.') * (sin(RADIANS(lon)) *

                                          sin('.$lon.') + cos(RADIANS(lon)) * 

                                          cos('.$lon.')) - sin(RADIANS(lat)) * sin('.$lat.')))) AS Distance 

                                          FROM ms_listing WHERE 

                                          '.$radius.' * SQRT(2*(1-cos(RADIANS(lat)) * 

                                          cos('.$lat.') * (sin(RADIANS(lon)) * 

                                          sin('.$lon.') + cos(RADIANS(lon)) * 

                                          cos('.$lon.')) - sin(RADIANS(lat)) * sin('.$lat.'))) <= '.$umkreis.' 

                                          ORDER BY Distance');


$rating = $ratingQuery->queryAll();

how can i pass the result to activedataprovider ? is it possible ?

Thanks once again :D

See http://www.yiiframework.com/doc-2.0/yii-data-arraydataprovider.html

It’s funny how you write ArrayDataProvider when you actually mean SqlDataProvider ;)

thank you guys… but it doesnt solve my probleme