cxmiaomu
在Order 模型里relations()方法增加一条关联
public function relations(){ return array( ... 'order_products' => array(self::HAS_MANY, 'OrderProduct', 'order_id'), ); }
http://www.yiiframework.com/doc/guide/1.1/zh_cn/database.arr#sec-4
在model和controller里都没有问题,就是在view里调用的实现,用Gridview好像不行。