joinWith('information')->where(['bd_notice.status'=>Notice::STATUS_ACTIVE,'bd_information.type'=>Information::INFORMATION ]); $time = time(); $datas = $datas->andwhere(['<' , 'bd_notice.release_time' , $time]); $datas = $datas->andwhere(['>' , 'bd_notice.over_time' , $time]); $datas = $datas->orderBy('bd_notice.updated_at DESC')->all(); return $this->render('index',['datas'=>$datas]); } //公告详细 public function actionNotice_detail() { $id = \Yii::$app->request->get('id'); $data = Notice::find()->joinWith('information')->where('bd_notice.id = :id',[':id'=>$id])->asArray()->one(); return $this->render('notice_detail',['data'=>$data]); } }