120], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'order_id' => 'Order ID', 'province' => 'Province', 'city' => 'City', 'district' => 'District', 'town' => 'Town', 'address' => 'Address', ]; } public function getRegionP() { return $this->hasOne(Region::className(), ['id' => 'province']); } public function getRegionC() { return $this->hasOne(Region::className(), ['id' => 'city']); } public function getRegionD() { return $this->hasOne(Region::className(), ['id' => 'district']); } public function getRegionT() { // dd($this->town); if($this->town){ return $this->hasOne(Region::className(), ['id' => 'town']); }else{ $string=''; return $string; } } }