1
I need an example, dropdownlist, where I can dropdown between two sqls, in this case A and B.
Below I present a pseudocode.
Introduction to the problem:
Table sql A
id_A
id_usuario
nome_A
descricao_A
Table sql B
id_B
id_A
nome_B
descricao_B
I need to dropdown with sql B, where all fields of sql A that have the id_usuario = 10
, but in sql B I do not have the id_usuario field, you should have something like Inner Join, but using yii2 dropdownlist.
The syntax below, which I am using does not solve, because it only presents the fields that satisfies id_A (sql A and B).
dropDownList(\yii\helpers\ArrayHelper::map(B::find()->where(['id_A' => $A->id_A])->all(),'id_B','nome_B') ,
P.S. I don’t want to put id_usuario in sql B.