/** * * @param integer $mid */ public function actionMakeBid($mid) { $meeting = Meeting::find()->where(['id' => $mid])->one(); $customer = $meeting->contactMoment->customer; Yii::$app->session->set('customer', $customer); $this->redirect(['/request-project/step-1']); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Meeting::find()->joinWith(['contactMoment.customer', 'creator']); $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([]); $query->andFilterWhere(['like', 'meeting.comment', $this->comment])->andFilterWhere(['like', 'customer.name', $this->contact_moment_id])->andFilterWhere(['like', 'user.username', $this->creator_id]); return $dataProvider; }
/** * Lists all Meeting models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Meeting::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }