title: yii2 : can't get data from two table with active record
body: <p>I want get data from two table <code>comments</code>,<code>users</code>.<br>
  <code>comments</code> have <code>hasOne</code> relation with <code>users</code></p>
  
  <pre><code>public function getUser()
      {
          return $this-&gt;hasOne(Users::className(), ['user_id' =&gt; 'user_id']);
      }
  </code></pre>
  
  <p>i want get <code>comments.comment_id</code>,<code>comments.comment_content</code>,<code>comments.user_id</code> from <code>comments</code> table and <code>uses.user_name</code> , <code>users.user_display_name</code> from <code>users</code> table to use in <code>gridview</code> widget.</p>
  
  <p>i use </p>
  
  <pre><code>$res = Comments::find()
              -&gt;select([
                  'comments.comment_id',
                  'comments.comment_content',
                  'comments.user_id',
                  'users.user_id',
                  'users.user_display_name',
                  'users.user_name',
              ])
              -&gt;innerJoinWith('user')
              -&gt;all();
  </code></pre>
  
  <p>this code get <code>comments</code> field but i can't get <code>users.user_name</code>,<code>users.user_display_name</code> from database.</p>
  
  <p>How should I do it?</p>
  
  <p>note:  user table in database is <code>users</code> but when i create model with Gii,relation method declare as <code>getUser()</code>, i don't know why.</p>
  
  <p><strong>update 1:</strong></p>
  
  <p><code>comments</code> table:</p>
  
  <pre><code>DROP TABLE IF EXISTS `comments`;
  CREATE TABLE `comments` (
    `comment_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `comment_content` text NOT NULL,
    `comment_approved` enum('no','yes') NOT NULL DEFAULT 'no',
    `comment_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    `comment_parent` bigint(20) unsigned NOT NULL DEFAULT '0',
    `sms_id` bigint(20) unsigned NOT NULL DEFAULT '0',
    `user_id` bigint(20) unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (`comment_id`),
    KEY `fk_comment_sms_id` (`sms_id`),
    KEY `fk_commetn_user_id` (`user_id`),
    CONSTRAINT `fk_comment_sms_id` FOREIGN KEY (`sms_id`) REFERENCES `sms` (`sms_id`),
    CONSTRAINT `fk_commetn_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p><code>users</code> table:</p>
  
  <pre><code>CREATE TABLE `users` (
    `user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `user_name` varchar(60) NOT NULL DEFAULT '',
    `user_pass` varchar(64) NOT NULL DEFAULT '',
    `user_level` int(11) NOT NULL DEFAULT '1',
    `user_email` varchar(100) NOT NULL DEFAULT '',
    `user_display_name` varchar(250) NOT NULL DEFAULT '',
    `user_phone_number` varchar(11) NOT NULL,
    `user_registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    `user_activation_key` varchar(60) NOT NULL,
    `user_status` enum('active','deactive','delete') NOT NULL DEFAULT 'deactive',
    PRIMARY KEY (`user_id`),
    UNIQUE KEY `u_user_sign` (`user_name`) USING BTREE,
    UNIQUE KEY `u_user_email` (`user_email`) USING BTREE
  ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
  </code></pre>