public function actionOwnerlist() { $response = array(); $query = Shopowner::find()->asArray()->all(); $response["data"] = $query; header('Content-type: application/json'); echo json_encode($response); }
public function actionDetails($OwnerId) { $model = Shopowner::findOne($OwnerId); $shopmodel = Shop::find()->where(['owner_id' => $OwnerId])->all(); //$connection = \Yii::$app->db; //echo $model->name; //exit; return $this->render('details', ['model' => $model, 'shopmodel' => $shopmodel]); }