public function getbrand() {
$model = $this->hasOne(Brand::className(), ['id' => 'brand_id'])->select('brand_name');
}
public function view($id) {
$model = LinkConfiguration::find()
->joinWith('brand')
->asArray()
->one();
echo "<pre>";
print_r($model);
exit;
}
It gives the following output:
Array
(
[id] => 1
[brand_id] => 2
[client_id] => 5551
[client_secret] => fsdfsdfdsf
[created_on] => 2021-03-15 18:01:27
[updated_on] =>
[status] => 0
[brand] => Array
(
[brand_name] => samples
)
)
Expected output:
Array
(
[id] => 1
[brand_id] => 2
[client_id] => 5551
[client_secret] => fsdfsdfdsf
[created_on] => 2021-03-15 18:01:27
[updated_on] =>
[status] => 0
[brand_name] => samples
)
Pls help me to solve this