public function actionSetting() { //$data=Yii::$app->request->post(); $data = array('interview_id' => '面试序号', 'user_id' => '面试者序号', 'interview_city' => '城市', 'interview_date' => '面试日期', 'interview_time' => '面试开始时间', 'create_time' => '创建时间', 'export_time' => '导出时间', 'notified' => '通知时间', 'status' => '预约状态'); $model = new Interview(); if ($model->load($data) && $model->save()) { return $this->redirect('success'); } else { return $this->render('setting', ['model' => $model]); } }
public function actionInterview() { $query = Interview::find()->where('reply is null')->orWhere("reply=''"); $pagination_noreply = new Pagination(['defaultPageSize' => 20, 'totalCount' => $query->count()]); $query->orderBy('updated_at desc')->offset($pagination_noreply->offset)->limit($pagination_noreply->limit); $query2 = Interview::find()->where('reply is not null')->andWhere("reply != ''"); $pagination_replied = new Pagination(['defaultPageSize' => 20, 'totalCount' => $query2->count()]); $query2->orderBy('updated_at desc')->offset($pagination_replied->offset)->limit($pagination_replied->limit); return $this->render('interview', ['noreply_interviews' => $query->all(), 'noreply_page' => $pagination_noreply, 'replied_interviews' => $query2->all(), 'replied_page' => $pagination_replied]); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Interview::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $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; } $query->andFilterWhere(['id' => $this->id, 'start_time' => $this->start_time, 'stop_time' => $this->stop_time, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'unit', $this->unit])->andFilterWhere(['like', 'place', $this->place])->andFilterWhere(['like', 'contact', $this->contact])->andFilterWhere(['like', 'contact_method', $this->contact_method])->andFilterWhere(['like', 'summary', $this->summary])->andFilterWhere(['like', 'reply', $this->reply])->andFilterWhere(['like', 'service', $this->service])->andFilterWhere(['like', 'others', $this->others]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Interview::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $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; } $query->andFilterWhere(['interview_id' => $this->interview_id, 'user_id' => $this->user_id, 'interview_date' => $this->interview_date, 'interview_time' => $this->interview_time, 'create_time' => $this->create_time, 'export_time' => $this->export_time, 'notified' => $this->notified, 'status' => $this->status]); $query->andFilterWhere(['like', 'interview_city', $this->interview_city]); return $dataProvider; }
public function getNewApp() { $interviews = Interview::all(); $mentors = Mentor::orderBy('name')->get(); $languages = Language::all(); $interests = Interest::all(); $meetings = Meeting::all(); $itemCount = 0; foreach ($interviews as $interview) { $numApps = count($interview->applications); if ($numApps == 0 || $numApps > 5) { unset($interviews[$itemCount]); } $itemCount++; } $application = new Application(); $application->id = "new"; $application->name = "new"; $application->facebook = "http://www.facebook.com/"; return view('pages.application', compact('interviews', 'mentors', 'languages', 'interests', 'meetings', 'application')); }
/** * Finds the Interview model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Interview the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Interview::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }