Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = TrRmMat::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['tr_rm_mat_id' => SORT_DESC]]]);
     $query->joinWith(['idTrMat.idMattraffic.idMaterial', 'idTrMat.idMattraffic.idMol.idperson', 'idTrMat.idMattraffic.idMol.iddolzh', 'idTrMat.idParent.idMaterial matparent', 'idTrMat.idParent.idMol molparent', 'idTrMat.idParent.idMol.idbuild', 'idTrMat.idParent.trOsnovs']);
     $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(['tr_rm_mat_id' => $this->tr_rm_mat_id, 'id_removeakt' => (string) filter_input(INPUT_GET, 'id'), 'id_tr_mat' => $this->id_tr_mat]);
     $query->andFilterWhere(['LIKE', 'matparent.material_name', $this->getAttribute('idTrMat.idParent.idMaterial.material_name')]);
     $query->andFilterWhere(['LIKE', 'matparent.material_inv', $this->getAttribute('idTrMat.idParent.idMaterial.material_inv')]);
     $query->andFilterWhere(['LIKE', 'matparent.material_serial', $this->getAttribute('idTrMat.idParent.idMaterial.material_serial')]);
     $query->andFilterWhere(['LIKE', 'idbuild.build_name', $this->getAttribute('idTrMat.idParent.idMol.idbuild.build_name')]);
     $query->andFilterWhere(['LIKE', 'idMaterial.material_name', $this->getAttribute('idTrMat.idMattraffic.idMaterial.material_name')]);
     $query->andFilterWhere(['LIKE', 'idMaterial.material_inv', $this->getAttribute('idTrMat.idMattraffic.idMaterial.material_inv')]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idTrMat.idMattraffic.mattraffic_number'));
     $query->andFilterWhere(['LIKE', 'idperson.auth_user_fullname', $this->getAttribute('idTrMat.idMattraffic.idMol.idperson.auth_user_fullname')]);
     $query->andFilterWhere(['LIKE', 'iddolzh.dolzh_name', $this->getAttribute('idTrMat.idMattraffic.idMol.iddolzh.dolzh_name')]);
     $query->andFilterWhere(['LIKE', 'trOsnovs.tr_osnov_kab', $this->getAttribute('idTrMat.idParent.trOsnovs.tr_osnov_kab')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idTrMat.idParent.idMaterial.material_name' => 'matparent', 'idTrMat.idParent.idMaterial.material_inv' => 'matparent', 'idTrMat.idParent.idMaterial.material_serial' => 'matparent', 'idTrMat.idParent.idMol.idbuild.build_name', 'idTrMat.idMattraffic.idMaterial.material_name', 'idTrMat.idMattraffic.idMaterial.material_inv', 'idTrMat.idMattraffic.mattraffic_number', 'idTrMat.idMattraffic.idMol.idperson.auth_user_fullname', 'idTrMat.idMattraffic.idMol.iddolzh.dolzh_name', 'idTrMat.idParent.trOsnovs.tr_osnov_kab']);
     return $dataProvider;
 }
Example #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Glprep::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['glprep_id' => SORT_DESC]]]);
     $query->joinWith(['idPreparat']);
     $this->load($params);
     // Отображает список препаратов глаукомного пациента в его карте
     if (isset($params['id'])) {
         $Glaukuchet = Glaukuchet::findOne(['id_patient' => $params['id']]);
         $query->andFilterWhere(['id_glaukuchet' => empty($Glaukuchet) ? -1 : $Glaukuchet->primaryKey]);
     } else {
         $query->andFilterWhere(['id_glaukuchet' => -1]);
     }
     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(['glprep_id' => $this->glprep_id, 'id_glaukuchet' => $this->id_glaukuchet, 'id_preparat' => $this->id_preparat, 'glprep_rlocat' => $this->glprep_rlocat]);
     $query->andFilterWhere(['LIKE', 'idPreparat.preparat_name', $this->getAttribute('idPreparat.preparat_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idPreparat.preparat_name']);
     return $dataProvider;
 }
Example #3
0
 public function search($params)
 {
     $query = Osmotraktmat::find();
     $query->select(['osmotraktmat_id', 'osmotraktmat_date', 'id_master', 'count(trMatOsmotrs.tr_mat_osmotr_id) AS osmotraktmat_countmat']);
     $query->joinWith(['idMaster.idperson idmasterperson', 'idMaster.iddolzh idmasterdolzh', 'trMatOsmotrs']);
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id_master' => $this->id_master]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'osmotraktmat_id'));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'osmotraktmat_date', Proc::Date));
     $query->groupBy(['osmotraktmat_id']);
     if (!empty($this->osmotraktmat_countmat)) {
         $w = Proc::WhereConstruct($this, 'osmotraktmat_countmat');
         $query->having('count(osmotraktmat_id) ' . $w[0] . $w[2]);
     }
     Proc::AssignRelatedAttributes($dataProvider, ['idMaster.idperson.auth_user_fullname', 'idMaster.iddolzh.dolzh_name']);
     $dataProvider->sort->attributes['osmotraktmat_countmat'] = ['asc' => ['count(osmotraktmat_id)' => SORT_ASC], 'desc' => ['count(osmotraktmat_id)' => SORT_DESC]];
     return $dataProvider;
 }
Example #4
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Spisosnovakt::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $query->joinWith(['idMol.idperson idpersonmol', 'idMol.iddolzh iddolzhmol', 'idMol.idpodraz idpodrazmol', 'idEmployee.idperson', 'idEmployee.iddolzh', 'idSchetuchet']);
     $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(['id_schetuchet' => $this->id_schetuchet, 'id_mol' => $this->id_mol, 'id_employee' => $this->id_employee]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'spisosnovakt_id'));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'spisosnovakt_date', Proc::Date));
     $query->andFilterWhere(['LIKE', 'idpersonmol.auth_user_fullname', $this->getAttribute('idMol.idperson.auth_user_fullname')]);
     $query->andFilterWhere(['LIKE', 'iddolzhmol.dolzh_name', $this->getAttribute('idMol.iddolzh.dolzh_name')]);
     $query->andFilterWhere(['LIKE', 'idpodrazmol.podraz_name', $this->getAttribute('idMol.idpodraz.podraz_name')]);
     $query->andFilterWhere(['LIKE', 'idperson.auth_user_fullname', $this->getAttribute('idEmployee.idperson.auth_user_fullname')]);
     $query->andFilterWhere(['LIKE', 'iddolzh.dolzh_name', $this->getAttribute('idEmployee.iddolzh.dolzh_name')]);
     $query->andFilterWhere(['LIKE', 'idSchetuchet.schetuchet_kod', $this->getAttribute('idSchetuchet.schetuchet_kod')]);
     $query->andFilterWhere(['LIKE', 'idSchetuchet.schetuchet_name', $this->getAttribute('idSchetuchet.schetuchet_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idMol.idperson.auth_user_fullname' => 'idpersonmol', 'idMol.iddolzh.dolzh_name' => 'iddolzhmol', 'idMol.idpodraz.podraz_name' => 'idpodrazmol', 'idEmployee.idperson.auth_user_fullname', 'idEmployee.iddolzh.dolzh_name', 'idSchetuchet.schetuchet_kod', 'idSchetuchet.schetuchet_name']);
     return $dataProvider;
 }
Example #5
0
 public function searchforgrupavid($params)
 {
     $query = Matvid::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['matvid_name' => SORT_ASC]]]);
     $query->joinWith(['grupavids']);
     $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(['matvid_id' => $this->matvid_id]);
     $query->andFilterWhere(['like', 'matvid_name', $this->matvid_name]);
     $query->andFilterWhere(['like', 'grupavids.grupa_main', $this->getAttribute('grupavids.grupa_main')]);
     Proc::AssignRelatedAttributes($dataProvider, ['grupavids.grupa_main']);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Importmaterial::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['importmaterial_combination' => SORT_ASC]]]);
     $query->joinWith(['idmatvid']);
     $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(['importmaterial_id' => $this->importmaterial_id, 'id_matvid' => $this->id_matvid]);
     $query->andFilterWhere(['like', 'importmaterial_combination', $this->importmaterial_combination]);
     $query->andFilterWhere(['LIKE', 'idmatvid.matvid_name', $this->getAttribute('idmatvid.matvid_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idmatvid.matvid_name']);
     return $dataProvider;
 }
Example #7
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Grupavid::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $query->joinWith(['idmatvid']);
     $this->load($params);
     $this->id_grupa = $params['id'];
     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(['grupavid_id' => $this->grupavid_id, 'grupavid_main' => $this->grupavid_main, 'id_grupa' => $this->id_grupa, 'id_matvid' => $this->id_matvid]);
     $query->andFilterWhere(['LIKE', 'idmatvid.matvid_name', $this->getAttribute('idmatvid.matvid_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idmatvid.matvid_name']);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Authitemchild::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $query->joinWith(['children']);
     $this->load($params);
     $this->parent = $params['id'];
     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(['like', 'parent', $this->parent])->andFilterWhere(['like', 'child', $this->child]);
     $query->andFilterWhere(['LIKE', 'children.description', $this->getAttribute('children.description')]);
     $query->andFilterWhere(['LIKE', 'children.type', $this->getAttribute('children.type')]);
     $query->andFilterWhere(['LIKE', 'children.name', $this->getAttribute('children.name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['children.description', 'children.type', 'children.name']);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Authassignment::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $query->joinWith(['itemname']);
     $this->load($params);
     $this->user_id = $params['id'];
     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(['user_id' => $this->user_id, 'created_at' => $this->created_at]);
     $query->andFilterWhere(['like', 'item_name', $this->item_name]);
     $query->andFilterWhere(['LIKE', 'itemname.description', $this->getAttribute('itemname.description')]);
     $query->andFilterWhere(['LIKE', 'itemname.type', $this->getAttribute('itemname.type')]);
     $query->andFilterWhere(['LIKE', 'itemname.name', $this->getAttribute('itemname.name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['itemname.description', 'itemname.type', 'itemname.name']);
     return $dataProvider;
 }
Example #10
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Removeakt::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['removeakt_id' => SORT_DESC]]]);
     $query->joinWith(['idRemover.idperson', 'idRemover.iddolzh']);
     $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(['removeakt_id' => $this->removeakt_id, 'id_remover' => $this->id_remover]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'removeakt_date', Proc::Date));
     $query->andFilterWhere(['LIKE', 'idperson.auth_user_fullname', $this->getAttribute('idRemover.idperson.auth_user_fullname')]);
     $query->andFilterWhere(['LIKE', 'iddolzh.dolzh_name', $this->getAttribute('idRemover.iddolzh.dolzh_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idRemover.idperson.auth_user_fullname', 'idRemover.iddolzh.dolzh_name']);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = RramatDocfiles::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $query->joinWith('idDocfiles');
     $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(['rramat_docfiles_id' => $this->rramat_docfiles_id, 'id_docfiles' => $this->id_docfiles, 'id_recoveryrecieveaktmat' => $params['id']]);
     $query->andFilterWhere(['LIKE', 'idDocfiles.docfiles_ext', $this->getAttribute('idDocfiles.docfiles_ext')]);
     $query->andFilterWhere(['LIKE', 'idDocfiles.docfiles_name', $this->getAttribute('idDocfiles.docfiles_name')]);
     $query->andFilterWhere(['LIKE', 'idDocfiles.docfiles_hash', $this->getAttribute('idDocfiles.docfiles_hash')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idDocfiles.docfiles_ext', 'idDocfiles.docfiles_name', 'idDocfiles.docfiles_hash']);
     return $dataProvider;
 }
Example #12
0
 public function searchForimportemployee($params)
 {
     $query = Impemployee::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['idemployee.idperson.auth_user_fullname' => SORT_ASC]]]);
     $query->joinWith(['idemployee.iddolzh', 'idemployee.idpodraz', 'idemployee.idbuild']);
     $this->load($params);
     $this->id_importemployee = $params['id'];
     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(['impemployee_id' => $this->impemployee_id, 'id_importemployee' => $this->id_importemployee, 'id_employee' => $this->id_employee]);
     $query->andFilterWhere(['LIKE', 'idemployee.employee_id', $this->getAttribute('idemployee.employee_id')]);
     $query->andFilterWhere(['LIKE', 'iddolzh.dolzh_name', $this->getAttribute('idemployee.iddolzh.dolzh_name')]);
     $query->andFilterWhere(['LIKE', 'idpodraz.podraz_name', $this->getAttribute('idemployee.idpodraz.podraz_name')]);
     $query->andFilterWhere(['LIKE', 'idbuild.build_name', $this->getAttribute('idemployee.idbuild.build_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idemployee.employee_id', 'idemployee.iddolzh.dolzh_name', 'idemployee.idbuild.build_name', 'idemployee.idpodraz.podraz_name']);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Spisosnovmaterials::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $query->joinWith(['idMattraffic.idMaterial']);
     $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(['spisosnovmaterials_id' => $this->spisosnovmaterials_id, 'id_mattraffic' => $this->id_mattraffic, 'id_spisosnovakt' => $this->id_spisosnovakt]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'spisosnovmaterials_number'));
     $query->andFilterWhere(['LIKE', 'idMaterial.material_name', $this->getAttribute('idMattraffic.idMaterial.material_name')]);
     $query->andFilterWhere(['LIKE', 'idMaterial.material_inv', $this->getAttribute('idMattraffic.idMaterial.material_inv')]);
     $query->andFilterWhere(['LIKE', 'idMaterial.material_serial', $this->getAttribute('idMattraffic.idMaterial.material_serial')]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idMattraffic.idMaterial.material_release', Proc::Date));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idMattraffic.idMaterial.material_price'));
     Proc::AssignRelatedAttributes($dataProvider, ['idMattraffic.idMaterial.material_name', 'idMattraffic.idMaterial.material_inv', 'idMattraffic.idMaterial.material_serial', 'idMattraffic.idMaterial.material_release', 'idMattraffic.idMaterial.material_price']);
     return $dataProvider;
 }
Example #14
0
 public function searchformaterialcontain($params)
 {
     $query = TrMat::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['tr_mat_id' => SORT_DESC]]]);
     $query->joinWith(['idInstallakt', 'idMattraffic.idMaterial', 'idMattraffic.idMol.idperson', 'idMattraffic.idMol.iddolzh', 'idParent', 'trRmMats']);
     $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->andWhere('tr_mat_id not in (select tmo.id_tr_mat from tr_mat_osmotr tmo where tmo.id_osmotraktmat = ' . $params['idosmotraktmat'] . ')');
     // grid filtering conditions
     $query->andFilterWhere(['tr_mat_id' => $this->tr_mat_id, 'id_mattraffic' => $this->id_mattraffic, 'id_parent' => $this->id_parent]);
     $query->andWhere(['trRmMats.id_tr_mat' => NULL]);
     $query->andWhere(['idParent.id_material' => $params['id']]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'id_installakt'));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idInstallakt.installakt_date'), 'date');
     $query->andFilterWhere(['LIKE', 'idMaterial.material_name', $this->getAttribute('idMattraffic.idMaterial.material_name')]);
     $query->andFilterWhere(['LIKE', 'idMaterial.material_inv', $this->getAttribute('idMattraffic.idMaterial.material_inv')]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idMattraffic.mattraffic_number'));
     $query->andFilterWhere(['LIKE', 'idperson.auth_user_fullname', $this->getAttribute('idMattraffic.idMol.idperson.auth_user_fullname')]);
     $query->andFilterWhere(['LIKE', 'iddolzh.dolzh_name', $this->getAttribute('idMattraffic.idMol.iddolzh.dolzh_name')]);
     $query->andFilterWhere(['LIKE', 'idbuild.build_name', $this->getAttribute('idMattraffic.idMol.idbuild.build_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idInstallakt.installakt_date', 'idMattraffic.idMaterial.material_name', 'idMattraffic.idMaterial.material_inv', 'idMattraffic.mattraffic_number', 'idMattraffic.idMol.idperson.auth_user_fullname', 'idMattraffic.idMol.iddolzh.dolzh_name', 'idMattraffic.idMol.idbuild.build_name']);
     return $dataProvider;
 }
Example #15
0
 public function searchforinstallakt_mat($params)
 {
     $query = Material::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['material_name' => SORT_ASC]]]);
     $query->joinWith(['idMatv', 'idIzmer']);
     $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(['material_id' => $this->material_id, 'material_tip' => $this->material_tip, 'material_writeoff' => $this->material_writeoff, 'id_matvid' => $this->id_matvid, 'id_izmer' => $this->id_izmer, 'material_importdo' => $this->material_importdo]);
     $query->andFilterWhere(['like', 'material_name', $this->material_name])->andFilterWhere(['like', 'material_name1c', $this->material_name1c])->andFilterWhere(['like', 'material_1c', $this->material_1c])->andFilterWhere(['like', 'material_inv', $this->material_inv])->andFilterWhere(['like', 'material_serial', $this->material_serial]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'material_release', Proc::Date));
     //    $query->andFilterWhere(Proc::WhereConstruct($this, 'material_number'));
     $query->andWhere(['material_number' => 1]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'material_price'));
     $query->andFilterWhere(['LIKE', 'idMatv.matvid_name', $this->getAttribute('idMatv.matvid_name')]);
     $query->andFilterWhere(['LIKE', 'idIzmer.izmer_name', $this->getAttribute('idIzmer.izmer_name')]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'material_username'));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'material_lastchange', Proc::DateTime));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'material_number'));
     Proc::AssignRelatedAttributes($dataProvider, ['idMatv.matvid_name', 'idIzmer.izmer_name']);
     return $dataProvider;
 }
Example #16
0
 public function searchformaterialmattraffic($params)
 {
     $query = Mattraffic::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['mattraffic_date' => SORT_DESC, 'mattraffic_id' => SORT_DESC]]]);
     $this->baseRelations($query);
     $query->joinWith(['trOsnovs', 'trMats.idParent.idMaterial matparent']);
     $query->andWhere(['mattraffic.id_material' => $params['id']]);
     $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;
     }
     $this->baseFilter($query);
     $query->andFilterWhere(['LIKE', 'trOsnovs.tr_osnov_kab', $this->getAttribute('trOsnovs.tr_osnov_kab')]);
     $query->andFilterWhere(['LIKE', 'matparent.material_inv', $this->getAttribute('trMats.idParent.idMaterial.material_inv')]);
     $this->baseSort($dataProvider);
     Proc::AssignRelatedAttributes($dataProvider, ['trOsnovs.tr_osnov_kab', 'trMats.idParent.idMaterial.material_inv' => 'matparent']);
     return $dataProvider;
 }
Example #17
0
 public function searchforauthuser($params)
 {
     $query = Employee::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['employee_id' => SORT_ASC]]]);
     $query->joinWith(['iddolzh', 'idpodraz', 'idbuild']);
     $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(['employee_id' => $this->employee_id, 'id_dolzh' => $this->id_dolzh, 'id_podraz' => $this->id_podraz, 'id_build' => $this->id_build, 'id_person' => $params['id']]);
     $query->andFilterWhere(['LIKE', 'iddolzh.dolzh_name', $this->getAttribute('iddolzh.dolzh_name')]);
     $query->andFilterWhere(['LIKE', 'idbuild.build_name', $this->getAttribute('idbuild.build_name')]);
     $query->andFilterWhere(['LIKE', 'idpodraz.podraz_name', $this->getAttribute('idpodraz.podraz_name')]);
     $query->andFilterWhere(['LIKE', 'employee_username', $this->getAttribute('employee_username')]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'employee_lastchange', Proc::DateTime));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'employee_dateinactive', Proc::Date));
     Proc::AssignRelatedAttributes($dataProvider, ['iddolzh.dolzh_name', 'idbuild.build_name', 'idpodraz.podraz_name']);
     return $dataProvider;
 }
Example #18
0
 public function searchformaterialkarta($params)
 {
     $query = TrMatOsmotr::find();
     $query->joinWith(['idTrMat.idMattraffic', 'idOsmotraktmat.idMaster.idperson', 'idOsmotraktmat.idMaster.iddolzh', 'idReason']);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['idOsmotraktmat.osmotraktmat_id' => SORT_DESC]]]);
     $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->andWhere(['idMattraffic.id_material' => $params['id']]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idOsmotraktmat.osmotraktmat_id'));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idOsmotraktmat.osmotraktmat_date', Proc::Date));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'tr_mat_osmotr_number'));
     $query->andFilterWhere(['LIKE', 'idReason.reason_text', $this->getAttribute('idReason.reason_text')]);
     $query->andFilterWhere(['LIKE', 'tr_mat_osmotr_comment', $this->getAttribute('tr_mat_osmotr_comment')]);
     $query->andFilterWhere(['LIKE', 'idperson.auth_user_fullname', $this->getAttribute('idOsmotraktmat.idMaster.idperson.auth_user_fullname')]);
     $query->andFilterWhere(['LIKE', 'iddolzh.dolzh_name', $this->getAttribute('idOsmotraktmat.idMaster.iddolzh.dolzh_name')]);
     Proc::AssignRelatedAttributes($dataProvider, ['idOsmotraktmat.osmotraktmat_id', 'idOsmotraktmat.osmotraktmat_date', 'idReason.reason_text', 'idOsmotraktmat.idMaster.idperson.auth_user_fullname', 'idOsmotraktmat.idMaster.iddolzh.dolzh_name']);
     return $dataProvider;
 }
Example #19
0
 private function glaukSort(&$dataProvider)
 {
     $dataProvider->sort->attributes['idFias.fias_city'] = ['asc' => ["IF (idFias.AOLEVEL < 7, idFias.OFFNAME, idFias2.OFFNAME)" => SORT_ASC], 'desc' => ["IF (idFias.AOLEVEL < 7, idFias.OFFNAME, idFias2.OFFNAME)" => SORT_DESC]];
     $dataProvider->sort->attributes['idFias.fias_street'] = ['asc' => ["IF (idFias.AOLEVEL < 7, '', idFias.OFFNAME)" => SORT_ASC], 'desc' => ["IF (idFias.AOLEVEL < 7, '', idFias.OFFNAME)" => SORT_DESC]];
     Proc::AssignRelatedAttributes($dataProvider, ['glaukuchets.glaukuchet_uchetbegin', 'glaukuchets.glaukuchet_detect', 'glaukuchets.glaukuchet_deregdate', 'glaukuchets.glaukuchet_deregreason', 'glaukuchets.glaukuchet_stage', 'glaukuchets.glaukuchet_operdate', 'glaukuchets.glaukuchet_invalid', 'glaukuchets.glaukuchet_lastvisit', 'glaukuchets.glaukuchet_lastmetabol', 'glaukuchets.idEmployee.idperson.auth_user_fullname', 'glaukuchets.idEmployee.iddolzh.dolzh_name', 'glaukuchets.idEmployee.idpodraz.podraz_name', 'glaukuchets.idEmployee.idbuild.build_name', 'glaukuchets.idClassMkb.code', 'glaukuchets.idClassMkb.name', 'glaukuchets.glaukuchet_lastchange', 'glaukuchets.glaukuchet_username']);
 }
Example #20
0
 public function searchemployee($params)
 {
     $query = Authuser::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['auth_user_fullname' => SORT_ASC]]]);
     $query->joinWith('employees', true, 'INNER JOIN');
     if (Yii::$app->user->can('Administrator')) {
         $query->joinWith(['profile']);
     }
     $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(['auth_user_id' => $this->auth_user_id]);
     $query->andFilterWhere(['like', 'auth_user_fullname', $this->auth_user_fullname]);
     if (Yii::$app->user->can('Administrator')) {
         $query->andFilterWhere(['like', 'profile.profile_inn', $this->getAttribute('profile.profile_inn')]);
         $query->andFilterWhere(Proc::WhereConstruct($this, 'profile.profile_dr', Proc::Date));
         $query->andFilterWhere(['like', 'profile.profile_address', $this->getAttribute('profile.profile_address')]);
         $query->andFilterWhere(['like', 'profile.profile_snils', $this->getAttribute('profile.profile_snils')]);
         $query->andFilterWhere(['profile.profile_pol' => $this->getAttribute('profile.profile_pol')]);
         $query->groupBy(['auth_user_id']);
         // Костыль для gridview, не отображает положенные 10 записей при сортировке или фильтрации.
         // Причина возможно в NULL значениях первичного ключа profile_id связанной модели Profile
         Proc::AssignRelatedAttributes($dataProvider, ['profile.profile_inn', 'profile.profile_dr', 'profile.profile_pol', 'profile.profile_address', 'profile.profile_snils']);
     }
     return $dataProvider;
 }
 public function searchformaterialkarta($params)
 {
     $query = Recoveryrecieveakt::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['idRecoverysendakt.recoverysendakt_date' => SORT_DESC, 'recoveryrecieveakt_date' => SORT_DESC]]]);
     $query->joinWith(['idRecoverysendakt', 'idOsmotrakt.idTrosnov.idMattraffic']);
     $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(['recoveryrecieveakt_repaired' => $this->recoveryrecieveakt_repaired, 'idMattraffic.id_material' => $params['id']]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'id_recoverysendakt'));
     $query->andFilterWhere(Proc::WhereConstruct($this, 'idRecoverysendakt.recoverysendakt_date'), 'date');
     $query->andFilterWhere(Proc::WhereConstruct($this, 'recoveryrecieveakt_date'), 'date');
     $query->andFilterWhere(['LIKE', 'recoveryrecieveakt_result', $this->getAttribute('recoveryrecieveakt_result')]);
     $query->andFilterWhere(Proc::WhereConstruct($this, 'id_osmotrakt'));
     Proc::AssignRelatedAttributes($dataProvider, ['idRecoverysendakt.recoverysendakt_date']);
     return $dataProvider;
 }