Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     //$codeRisk = Yii::$app->db->createCommand('SELECT code FROM risk')->queryAll();
     $query = RiskBooking::find()->Where('RiskGrp = \'RG001\'')->orderBy(['Code' => SORT_DESC]);
     //->andWhere(['Code' => $codeRisk])->exists();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 20]]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     // grid filtering conditions
     $query->andFilterWhere(['ReportDate' => $this->ReportDate, 'RiskEffDate' => $this->RiskEffDate, 'RiskDetectDate' => $this->RiskDetectDate, 'ConfirmDate' => $this->ConfirmDate, 'StartEditDate' => $this->StartEditDate, 'FinishDate_Edit' => $this->FinishDate_Edit, 'EditDate' => $this->EditDate, 'RiskEffDate_Final' => $this->RiskEffDate_Final, 'RiskDetectDate_Final' => $this->RiskDetectDate_Final, 'StartEditDate_Final' => $this->StartEditDate_Final, 'FinishDate_Final' => $this->FinishDate_Final, 'EditDate_Final' => $this->EditDate_Final, 'SuccessDate' => $this->SuccessDate, 'LmdfDate' => $this->LmdfDate, 'RecDate' => $this->RecDate, 'AddDate' => $this->AddDate, 'mdfDate' => $this->mdfDate, 'CancelDate' => $this->CancelDate, 'LoginConfirmDate' => $this->LoginConfirmDate]);
     $query->andFilterWhere(['like', 'IRID', $this->IRID])->andFilterWhere(['like', 'Corp', $this->Corp])->andFilterWhere(['like', 'Branch', $this->Branch])->andFilterWhere(['like', 'Code', $this->Code])->andFilterWhere(['like', 'SectRecord', $this->SectRecord])->andFilterWhere(['like', 'SectRefer', $this->SectRefer])->andFilterWhere(['like', 'SectEff', $this->SectEff])->andFilterWhere(['like', 'SectofPateint', $this->SectofPateint])->andFilterWhere(['like', 'RiskGrp', $this->RiskGrp])->andFilterWhere(['like', 'RiskSubGrp', $this->RiskSubGrp])->andFilterWhere(['like', 'RiskType', $this->RiskType])->andFilterWhere(['like', 'Risk', $this->Risk])->andFilterWhere(['like', 'RiskEffGrp', $this->RiskEffGrp])->andFilterWhere(['like', 'RiskEff', $this->RiskEff])->andFilterWhere(['like', 'Detail01', $this->Detail01])->andFilterWhere(['like', 'Detail02', $this->Detail02])->andFilterWhere(['like', 'WorkPeriod', $this->WorkPeriod])->andFilterWhere(['like', 'ReportTime', $this->ReportTime])->andFilterWhere(['like', 'RiskDetectGrp', $this->RiskDetectGrp])->andFilterWhere(['like', 'RiskDetect', $this->RiskDetect])->andFilterWhere(['like', 'HN_No', $this->HN_No])->andFilterWhere(['like', 'RiskDetail', $this->RiskDetail])->andFilterWhere(['like', 'RiskDetailFile', $this->RiskDetailFile])->andFilterWhere(['like', 'RiskEffRcv', $this->RiskEffRcv])->andFilterWhere(['like', 'IntroduManage', $this->IntroduManage])->andFilterWhere(['like', 'IntroduManageFile', $this->IntroduManageFile])->andFilterWhere(['like', 'IP_Rept', $this->IP_Rept])->andFilterWhere(['like', 'Domain_Rept', $this->Domain_Rept])->andFilterWhere(['like', 'PCName_Rept', $this->PCName_Rept])->andFilterWhere(['like', 'ReportBy', $this->ReportBy])->andFilterWhere(['like', 'RiskGrp_Conf', $this->RiskGrp_Conf])->andFilterWhere(['like', 'RiskSubGrp_Conf', $this->RiskSubGrp_Conf])->andFilterWhere(['like', 'RiskType_Conf', $this->RiskType_Conf])->andFilterWhere(['like', 'Risk_Conf', $this->Risk_Conf])->andFilterWhere(['like', 'RiskEff_Conf', $this->RiskEff_Conf])->andFilterWhere(['like', 'RiskDetect_Conf', $this->RiskDetect_Conf])->andFilterWhere(['like', 'HN_No_Conf', $this->HN_No_Conf])->andFilterWhere(['like', 'RiskEffRcv_Conf', $this->RiskEffRcv_Conf])->andFilterWhere(['like', 'RiskConfirm', $this->RiskConfirm])->andFilterWhere(['like', 'RiskConfirmRemark', $this->RiskConfirmRemark])->andFilterWhere(['like', 'RiskEditorLevel', $this->RiskEditorLevel])->andFilterWhere(['like', 'IsNeedCoEditor', $this->IsNeedCoEditor])->andFilterWhere(['like', 'Advice', $this->Advice])->andFilterWhere(['like', 'AdviceFile', $this->AdviceFile])->andFilterWhere(['like', 'IP_Conf', $this->IP_Conf])->andFilterWhere(['like', 'Domain_Conf', $this->Domain_Conf])->andFilterWhere(['like', 'PCName_Conf', $this->PCName_Conf])->andFilterWhere(['like', 'ConfirmBy', $this->ConfirmBy])->andFilterWhere(['like', 'RiskGrp_Edit', $this->RiskGrp_Edit])->andFilterWhere(['like', 'RiskSubGrp_Edit', $this->RiskSubGrp_Edit])->andFilterWhere(['like', 'RiskType_Edit', $this->RiskType_Edit])->andFilterWhere(['like', 'Risk_Edit', $this->Risk_Edit])->andFilterWhere(['like', 'RiskEff_Edit', $this->RiskEff_Edit])->andFilterWhere(['like', 'EditingDetail', $this->EditingDetail])->andFilterWhere(['like', 'EditingDetailFile', $this->EditingDetailFile])->andFilterWhere(['like', 'SystemChng', $this->SystemChng])->andFilterWhere(['like', 'SystemChange', $this->SystemChange])->andFilterWhere(['like', 'SystemChangeFile', $this->SystemChangeFile])->andFilterWhere(['like', 'EditStatus', $this->EditStatus])->andFilterWhere(['like', 'CloseStatus', $this->CloseStatus])->andFilterWhere(['like', 'IP_Edit', $this->IP_Edit])->andFilterWhere(['like', 'Domain_Edit', $this->Domain_Edit])->andFilterWhere(['like', 'PCName_Edit', $this->PCName_Edit])->andFilterWhere(['like', 'EditBy', $this->EditBy])->andFilterWhere(['like', 'CoEditor', $this->CoEditor])->andFilterWhere(['like', 'SectRecord_Final', $this->SectRecord_Final])->andFilterWhere(['like', 'SectRefer_Final', $this->SectRefer_Final])->andFilterWhere(['like', 'RiskGrp_Final', $this->RiskGrp_Final])->andFilterWhere(['like', 'RiskSubGrp_Final', $this->RiskSubGrp_Final])->andFilterWhere(['like', 'RiskType_Final', $this->RiskType_Final])->andFilterWhere(['like', 'Risk_Final', $this->Risk_Final])->andFilterWhere(['like', 'RiskEff_Final', $this->RiskEff_Final])->andFilterWhere(['like', 'WorkPeriod_Final', $this->WorkPeriod_Final])->andFilterWhere(['like', 'ReportTime_Final', $this->ReportTime_Final])->andFilterWhere(['like', 'RiskDetect_Final', $this->RiskDetect_Final])->andFilterWhere(['like', 'HN_No_Final', $this->HN_No_Final])->andFilterWhere(['like', 'RiskEffRcv_Final', $this->RiskEffRcv_Final])->andFilterWhere(['like', 'FinalEditStatus', $this->FinalEditStatus])->andFilterWhere(['like', 'GetSysChngFromEdit', $this->GetSysChngFromEdit])->andFilterWhere(['like', 'SystemChng_Final', $this->SystemChng_Final])->andFilterWhere(['like', 'SystemChange_Final', $this->SystemChange_Final])->andFilterWhere(['like', 'SystemChangeFile_Final', $this->SystemChangeFile_Final])->andFilterWhere(['like', 'Revision', $this->Revision])->andFilterWhere(['like', 'IP_Final', $this->IP_Final])->andFilterWhere(['like', 'Domain_Final', $this->Domain_Final])->andFilterWhere(['like', 'PCName_Final', $this->PCName_Final])->andFilterWhere(['like', 'EditBy_Final', $this->EditBy_Final])->andFilterWhere(['like', 'Revision01', $this->Revision01])->andFilterWhere(['like', 'Revision02', $this->Revision02])->andFilterWhere(['like', 'Revision03', $this->Revision03])->andFilterWhere(['like', 'Revision04', $this->Revision04])->andFilterWhere(['like', 'Revision05', $this->Revision05])->andFilterWhere(['like', 'ReviseGrp', $this->ReviseGrp])->andFilterWhere(['like', 'RecBy', $this->RecBy])->andFilterWhere(['like', 'RiskFixed', $this->RiskFixed])->andFilterWhere(['like', 'CreateBy', $this->CreateBy])->andFilterWhere(['like', 'UpdateBy', $this->UpdateBy])->andFilterWhere(['like', 'CancelBy', $this->CancelBy])->andFilterWhere(['like', 'RiskComplete', $this->RiskComplete])->andFilterWhere(['like', 'FixByUserGrp', $this->FixByUserGrp])->andFilterWhere(['like', 'RechkConfirm', $this->RechkConfirm])->andFilterWhere(['like', 'ChkByUpper', $this->ChkByUpper])->andFilterWhere(['like', 'MeetingLv1', $this->MeetingLv1])->andFilterWhere(['like', 'MeetingLv2', $this->MeetingLv2])->andFilterWhere(['like', 'ReviseByUserA', $this->ReviseByUserA])->andFilterWhere(['like', 'ReviseByUserS', $this->ReviseByUserS])->andFilterWhere(['like', 'AdviceByUserS', $this->AdviceByUserS])->andFilterWhere(['like', 'RqtMeeting', $this->RqtMeeting])->andFilterWhere(['like', 'ReviseByUserA2', $this->ReviseByUserA2])->andFilterWhere(['like', 'MainRefer', $this->MainRefer])->andFilterWhere(['like', 'EditingDetail_Final', $this->EditingDetail_Final])->andFilterWhere(['like', 'EditingDetail_FinalFile', $this->EditingDetail_FinalFile])->andFilterWhere(['like', 'IsEditable', $this->IsEditable])->andFilterWhere(['like', 'IsGuildLine', $this->IsGuildLine]);
     //->andFilterWhere(['like', 'riskName', $this->riskName])
     //->andFilterWhere(['like', 'RiskEff.Name', $this->riskEffName])
     //->andFilterWhere(['like', 'sectRecName', $this->sectRecName]);
     return $dataProvider;
 }
Esempio n. 2
0
 protected function findModels($code)
 {
     if (($models = RiskBooking::findOne($code)) !== null) {
         return $models;
     } else {
         throw new NotFoundHttpException('The requested page does not exist. #2');
     }
 }
Esempio n. 3
0
 /**
  * Finds the RiskBooking model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $Branch
  * @param string $Code
  * @param string $Corp
  * @return RiskBooking the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($Branch, $Code, $Corp)
 {
     if (($model = RiskBooking::findOne(['Branch' => $Branch, 'Code' => $Code, 'Corp' => $Corp])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }