The issue is solved hard but the model is solved so
<?php namespace common\models; use Yii; /** * This is the model class for table "fl_actours". * * @property integer $id * @property string $name * @property string $biography */ class FilmsFordate extends \yii\db\ActiveRecord { public static function tableName() { return 'fl_filmsFordate'; } }?>
Controller
Yii::$app->db->createCommand(" CREATE OR REPLACE VIEW fl_filmsFordate(id,name,created_at) AS SELECT id, name_film, created_at FROM `fl_films` UNION SELECT id, name_serial, created_at FROM `fl_serial` ORDER BY created_at DESC LIMIT 0 , 20"); $last= FilmsFordate::find()->all();
the truth with the tie must be updated, and everything works. This article helped a lot. Thanks to all.