-1
public function actionIndex() {
$sales = Sale::model()->findAll();
$news = News::model()->findAll();
$merged = CMap::mergeArray($sales, $news);
$this->render('index', array(
'merged ' => $merged
));
}
如何对任何字段(例如创建的字段)合并的$进行排序?在YII中对合并数组进行排序
这是非常不好做这样的事情。你为什么想这样做?你不能只加入表格吗?为什么你使用AR来合并数组对象。 – ineersa
谢谢你的回答。我如何加入表格? – Bennington