There are 3 tables ( order , order_delivery , order_types ). For all created models for order gridview. In the order table there is an order_number column, in the order_delivery table, the order_delivery and order_delivery_code , in the order_types table in the delivery_types_code and delivery_types_name columns. I can create a function in the Order model. Function public function getType(){ return $this->hasOne(OrderDelivery::className(), ['order_id' => 'order_id']); } public function getType(){ return $this->hasOne(OrderDelivery::className(), ['order_id' => 'order_id']); } in the 'type.order_delivery_code' index and output the delivery codes from order_delivery . The question is how, instead of delivery codes, to output the decryption from the 3 table delivery_types_name ?
Upd. Did so.
public function getType(){ return $this->hasOne(DeliveryTypes::className(), ['delivery-types_code' => 'order_delivery_code']) ->viaTable('order_delivery', ['order_id' => 'order_id']); } public function getType(){ return $this->hasOne(DeliveryTypes::className(), ['delivery-types_code' => 'order_delivery_code']) ->viaTable('order_delivery', ['order_id' => 'order_id']); } Thank you all for participating.
OrderorOrderSearch? show approximate code please. - cruim