我有两个数据提供者,就像这样。
$marks=new Assignmentmarks;
$student=new student;
$criteria_st=new CDbCriteria;
$criteria_marks=new CDbCriteria;
$criteria_st->compare('st_id', $student->st_id);
$criteria_st->addInCondition('st_id', $studentid);
$criteria_st->compare('st_name', $student->st_name);
$criteria_marks->compare('marks_cr1', $marks->marks_cr1,TRUE);
$criteria_marks->compare('marks_cr2', $marks->marks_cr2,TRUE);
$criteria_marks->compare('marks_cr3', $marks->marks_cr3,TRUE);
$criteria_marks->compare('marks_cr4', $marks->marks_cr4,TRUE);
$criteria_marks->compare('marks_cr5', $marks->marks_cr5,TRUE);
$DataProvider1= new CActiveDataProvider($student, array('criteria_st'=>$criteria_st,));
$DataProvider2= new CActiveDataProvider($marks, array('criteria_marks'=>$criteria_marks,));
我需要将这两个数据提供者放到 CGridView 中。
任何人都可以告诉我如何做到这一点,或者如果有其他方法可以做到这一点,我也喜欢知道吗?