controllers

  $test = $dataProvider->getModels(); 分配过去

view index

//Yii::$app->view->params['test'] = $test;

column

  [
                 'attribute' => 'mom',
                 'format' => 'raw',
                 'value' => function($model,$key,$index){
                         return ( $this->params['test'][$index]->id );
                         if(isset($this->params['test'][$index + 1])){
                             return ( $this->params['test'][$index + 1]->money );
                         }

                     }
             ],

posted on 2017-07-07 17:32  allen817  阅读(123)  评论(0编辑  收藏  举报