/** * 到达产品详情页面 * @AuthorHTL * @DateTime 2016-01-12T17:21:01+0800 * @return [type] [description] */ public function actionIndex3() { $id = Yii::$app->request->get("id"); $model = MirProduct::findOne(["product_id" => $id]); // p($model); return $this->render('index3', ['model' => $model]); }
/** * Finds the MirProduct model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return MirProduct the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = MirProduct::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }