D
D
daivanov2014-03-04 08:48:50
Yii
daivanov, 2014-03-04 08:48:50

How to deal with models in Yii?

Hey!
I can't deal with the following problem in any way:
Model Event - events, meetings, events;
Model Participant - users of the system;
The Participation model is a record of which user signed up for which event.
relations are filled.
Users are divided into those who perform and spectators (special field).
The Event specifies the maximum possible number for the participation of some and other users.
So, it is not possible to display the number of speakers already signed up and the number of viewers already signed up in the grid in the admin panel.
As I understand it, it is necessary to add a subquery to the participant and participation tables in the Event. Everything is ok with sql, I don't understand how to do it in Yii.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Gubarev, 2014-03-04
@daivanov

Look towards STAT relations and modifying the search method of the model that is displayed in the grid. a good example of the implementation of your task here www.yiiframework.com/wiki/319/searching-and-sortin...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question