/** * @return \yii\db\ActiveQuery */ public function getOsmotrakts() { return $this->hasOne(Osmotrakt::className(), ['id_tr_osnov' => 'tr_osnov_id'])->from(['osmotrakts' => Osmotrakt::tableName()]); }
/** * Finds the Osmotrakt model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Osmotrakt the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Osmotrakt::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getIdOsmotrakt() { return $this->hasOne(Osmotrakt::className(), ['osmotrakt_id' => 'id_osmotrakt'])->from(['idOsmotrakt' => Osmotrakt::tableName()])->inverseOf('recoveryrecieveakts'); }
/** * @return \yii\db\ActiveQuery */ public function getOsmotrakts() { return $this->hasMany(Osmotrakt::className(), ['id_reason' => 'reason_id'])->from(['osmotrakts' => Osmotrakt::tableName()])->inverseOf('idReason'); }
/** * @return \yii\db\ActiveQuery */ public function getOsmotrakts0() { return $this->hasMany(Osmotrakt::className(), ['id_master' => 'employee_id'])->from(['osmotraktsmaster' => Osmotrakt::tableName()]); }
public function searchformaterialkarta($params) { $query = Osmotrakt::find(); $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['osmotrakt_id' => SORT_DESC]]]); $query->joinWith(['idTrosnov.idMattraffic', 'idUser.idperson idpersonuser', 'idUser.iddolzh iddolzhuser', 'idUser.idbuild idbuilduser', 'idMaster.idperson idpersonmaster', 'idMaster.iddolzh iddolzhmaster', 'idReason']); 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->andWhere(['idMattraffic.id_material' => $params['id']]); $query->andFilterWhere(Proc::WhereConstruct($this, 'osmotrakt_id')); $query->andFilterWhere(Proc::WhereConstruct($this, 'osmotrakt_date', Proc::Date)); $query->andFilterWhere(['LIKE', 'idReason.reason_text', $this->getAttribute('idReason.reason_text')]); $query->andFilterWhere(['LIKE', 'osmotrakt_comment', $this->getAttribute('osmotrakt_comment')]); $query->andFilterWhere(['LIKE', 'idpersonuser.auth_user_fullname', $this->getAttribute('idUser.idperson.auth_user_fullname')]); $query->andFilterWhere(['LIKE', 'iddolzhuser.dolzh_name', $this->getAttribute('idUser.iddolzh.dolzh_name')]); $query->andFilterWhere(['LIKE', 'idbuilduser.build_name', $this->getAttribute('idUser.idbuild.build_name')]); $query->andFilterWhere(['LIKE', 'idpersonmaster.auth_user_fullname', $this->getAttribute('idMaster.idperson.auth_user_fullname')]); $query->andFilterWhere(['LIKE', 'iddolzhmaster.dolzh_name', $this->getAttribute('idMaster.iddolzh.dolzh_name')]); Proc::AssignRelatedAttributes($dataProvider, ['idReason.reason_text', 'idUser.idperson.auth_user_fullname' => 'idpersonuser', 'idUser.iddolzh.dolzh_name' => 'iddolzhuser', 'idUser.idbuild.build_name' => 'idbuilduser', 'idMaster.idperson.auth_user_fullname' => 'idpersonmaster', 'idMaster.iddolzh.dolzh_name' => 'iddolzhmaster']); return $dataProvider; }