public function getFajlRel()
 {
     return $this->hasOne(Fajl::className(), ['id' => 'fajl'])->from(Fajl::tableName() . ' otraslevoe_soglashenie_fajl');
 }
示例#2
0
 public function actionSaveIspytanie()
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $result = ['result' => 'error'];
     $zayvlenie_id = isset($_REQUEST['zayavlenie_id']) ? $_REQUEST['zayavlenie_id'] : false;
     $file_id = isset($_REQUEST['file_id']) ? $_REQUEST['file_id'] : false;
     $tip = isset($_REQUEST['tip']) ? $_REQUEST['tip'] : false;
     if ($zayvlenie_id) {
         $zayvlenie = ZayavlenieNaAttestaciyu::findOne($zayvlenie_id);
         if ($tip == 'portfolio') {
             $zayvlenie->portfolio = $file_id;
         }
         if ($tip == 'var_isp2') {
             $zayvlenie->var_ispytanie_2_fajl = $file_id;
         }
         if ($tip == 'var_isp3') {
             $zayvlenie->var_ispytanie_3_fajl = $file_id;
         }
         if ($tip == 'prezentatsiya') {
             $zayvlenie->prezentatsiya = $file_id;
         }
         if ($zayvlenie->save()) {
             $result['result'] = 'success';
             $file = Fajl::findOne($file_id);
             $result['html'] = $file->getFileLink();
         }
     }
     return $result;
 }
示例#3
0
 public function getFajlRel()
 {
     return $this->hasOne(Fajl::className(), ['id' => 'fajl']);
 }
 public function getSvedeniyaOSebeFajlRel()
 {
     return $this->hasOne(Fajl::className(), ['id' => 'svedeniya_o_sebe_fajl'])->inverseOf('zayavlenieNaAttestaciyuSvedeniyaOSebeRel')->from(Fajl::tableName() . ' svedeniya_o_sebe_fajl');
 }