1.MODEL

如关联user table

  public function getUser(){
        return$this->hasOne(User::className(),['id'=>'uid']); //关联字段
    }

2.COTROLLER

  $excelModel = Capital::find()->with([
                'user' => function($query) { $query->select(['id','username']);},//查询关联字段
            ]);

3.VIEW

  [
                'attribute' => 'uid',   //关联字段
                'value' => 'user.username',
            ],

 

 下拉框

http://www.yiichina.com/tutorial/712

一些设置

http://www.poluoluo.com/jzxy/201604/472063.html

分页设置

http://blog.csdn.net/m_422744746/article/details/51470052

 

posted on 2016-08-25 09:11  allen817  阅读(363)  评论(0编辑  收藏  举报