Why doesn't the Count(*) as?

So I write

$top=Watch::find()
 ->select(['fl_serial.*,fl_watch.*,COUNT(fl_watch.active=1) AS total_count'])
->joinWith('serial','fl_watch.id_serial=serial.id')
->groupBy('fl_watch.id_serial')
->orderBy(['total_count'=>SORT_DESC])
->limit(10)
 ->all();


then the process as

foreach($top as $post){
 $posts[]=$post->total_count;}


get `Getting unknown property: common\models\Watch::total_count` how to process `COUNT( * ) AS total_count`
July 9th 19 at 13:43
1 answer
July 9th 19 at 13:45
apparently in model Watch no properties total_count, accordingly it is necessary to add:
public $total_count;

Find more questions by tags Yii