I have this database schema with tables such as project (tombstone), risks (project risks), issues (project issues), deliverables (project deliverables) etc… I must build a report that will show the project tombstone data as well as its risks, deliverables, issues… A kind of project snapshot report (all in one).
I am considering three approaches to retrieve data.
Not necessarily. You can just add some method to Project model, for example getReport and then use it like $items = Project::model()->report. Or return DataProvider. Or something else.
My point is, sql in controllers is bad, it ruins MVC concept.
Actually you can have models without having corresponding db table