A
A
alex stephen2016-01-29 17:45:27
Yii
alex stephen, 2016-01-29 17:45:27

Yii2 DetailView relations group_concat?

Hello.
My problem is this.
I am writing in Yii2.
In the data provider for the GridView, there is a request with "joinwith".
In fact, it pulls data from another table, implementing the first normal form ( https://ru.wikipedia.org/wiki/First_normal_form ).
The jamb is that if, say, we have 10 records, each of which has 3 tags, then the widget claims that we have displayed 30 records. In normal SQL, this would be solved by group_concat. What to do here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex stephen, 2016-01-29
@berezuev

I decided myself.
It was enough to add ->groupBy('id');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question