Fixed addind join in db/Query

I was need use joinWith in AR by the some condition, like this:
$query = User::find()->joinWith('posts');
if ($something) {
	$query->joinWith('posts.comments');	
}
The sql I get is :

SELECT `user`.* FROM `user` 
LEFT JOIN `post` ON `user`.`id` = `post`.`user_id` 
LEFT JOIN `post` ON `user`.`id` = `post`.`user_id` 
LEFT JOIN `comment` ON `post`.`id` = `comment`.`post_id`

so I get mistake 'SQL Error (1066): Not unique table/alias: 'post''.
Here is my solution for this problem.