Group conditions and view table

em emrahsevgi 09 Feb, 2019
Hi;
​
I have 3 table in read_data function. Model names are case, applicant and party. applicant and party models are relaeted to case. foreign key is case_id. Relation is "one matching record, foreign key in this table" Relation Condition is party.case_id:case.case_id
​
I can input much more party which are case_id is same with case.case_id.
​
I have a tableview which name is case_list. that view output is:
​
Sıra No CASE ID Applicant Party
1 950678196 fghfghfgh ytrtyrtytry
2 950678196 fghfghfgh uyuıyuıuyı
​
This table show as if 2 records. Because of inputed 2 party name. But 2nd party name is related 1st case_id and applicant. I want to show 2nd party nameunder first partyname with 1st party name. Like this:
​
Sıra No CASE ID Applicant Party
1 950678196 fghfghfgh ytrtyrtytry
uyuıyuıuyı
​
I guess I have to use Group conditions in read_data function party model. But I don't now how? Can I groupped party names which they have same case_id s?
​
My tableview is:
​
provider= {var:read_data}
​
Columns list=
counter:Sıra No
case.case_id:CASE ID
applicantcode:Applicant
partycode:Party
​
Columns views=
counter:{fn:row_counter}
applicantcode:{var:case_list.row.applicant.applicantname}{var:case_list.row.applicant.applicantcompany}
partycode:{var:case_list.row.party.name}{var:case_list.row.party.company}
​
PS: {var:case_list.row.applicant.applicantcompany} show if it has been inputed
​
Thanks.
he healyhatman 12 Feb, 2019
Still not entirely 100% on what you're after. But I think maybe in your "fields to retrieve" you can try
​
GROUP_CONCAT(DISTINCT partymodel.partycode SEPARATOR '<br>'):partymodel.partycodealias
along with all your other fields.
​
And make sure you're using the group by field as well, probably group by case ID
This topic is locked and no more replies can be posted.