public function actionShoplist() { $response = array(); $query = Shop::find()->asArray()->all(); //print_r($query);exit; $response["status"] = "success"; $response["message"] = "Product listed successfully."; $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]); }