Using hasMany as to the number of comments(lie in 3 equal separate tables) each entry?

Good evening all !
In General, as to the number of comments each entry if the Comments are in one table, the entries you write, and actually the final:
public function getComment()
 return $this->hasMany(Comments::className(),['post_id' => 'id'])->select('id,post_id');

But the task was slightly different, I have 3 identical tables with comments:
1) table - comments_blog
2) table - comments_blog_2
3) table - comments_blog_3

Comments will be distributed between the table depending on the modulo of the ID of the record to 3 (i.e. $id % 3);
Now here's the Dilema, how to associate 3 models Comments one how to link all this through the UNION and put in $this->hasMany() or other way I do not understand. Any help would be appreciated.

Thank you all in advance !
June 5th 19 at 21:50
1 answer
June 5th 19 at 21:52
In General, much easier than I thought) Here, if anyone is interested.
Since I already had a method that returned the full path to the Class each individual table of comments, then the record Class write this:
public function getComment($postID)
 return $this->hasMany(ComentsBlogObject::changeDB($postID)::className(),['post_id' => 'id'])->select('COUNT(*)');

Well, in the controller check that we did everything right:
$model = ArticleBlog::find()->limit(3)->all();
foreach ($model as $key => $value) {
 print_r($value->getComment($value->id)->count() );

Find more questions by tags MySQLYii