A
A
Alexander2013-04-26 10:29:22
Yii
Alexander, 2013-04-26 10:29:22

Is CActiveDataProvider + CListView + FROM (select) possible?

Good afternoon. I have a query like:

SELECT  * FROM (SELECT `t`.* FROM `table` `t` JOIN table2 t2 ON t2.id = t.column_id WHERE t2.column2_id = 1) as t1 GROUP BY `t1`.`id`

Is it possible to execute such a query for CActiveDataProvider and display the result via CListView?
While it turned out to be done through CSqlDataProvider, but after that CListView does not display data
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2013-04-26
@baltazorbest

The question is closed. Rewrote the query and use CActiveDataProvider

J
Jodes, 2013-04-26
@Jodes

Try to pass the result of the query to CArrayDataProvider and display it in CListView.

J
Jodes, 2013-04-26
@Jodes

Quite right. Use a query builder or write in pure SQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question