N
N
Nikolay Melnik2016-09-19 10:28:30
Yii
Nikolay Melnik, 2016-09-19 10:28:30

How to make a dependency in yii2 between tables?

Hello.
There was a problem with the correct spelling of the dependency between the tables.
Tables:

Account (ownerType, ownerId, name, currency, balance ...)

and
PartnerCode
I do a search by PartnerCode through the generated gii PartnersCodeSearch.
It is necessary to display the balance for the code in the resulting table.
But the connection between these tables is as follows
Account.ownerId = PartnerCode.id 
Account.ownerType = 'code'
Account.name = 'stock-'.PartnerCode.partnerId

How to correctly make a link in the PartnerCode table with the Account table
or is it better to do it through join in PartnersCodeSearch

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-09-19
@slo_nik

Working with linked data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question