예제 #1
0
 /**
  * 奇趣测试 结果
  */
 public function actionStep4($id)
 {
     $this->layout = false;
     $model = Survey::findOne($id);
     // 没有找到
     if (!$model) {
         $model = new Survey();
         if (!$model) {
             return $this->redirect(['my']);
         }
     }
     // 查询所有结果
     $condition['s_id'] = $id;
     $a_SurveyResulte = SurveyResulte::findAll($condition);
     isset($a_SurveyResulte[0]) ? null : ($a_SurveyResulte = []);
     $model_SurveyResulte = new SurveyResulte();
     $post = Yii::$app->request->post();
     // 保存结果
     $model_SurveyResulte = new SurveyOperation();
     $url = $model_SurveyResulte->step4SaveResulteCondition1($post, $condition, $id);
     if ($url) {
         $model->is_publish = 1;
         $model->save();
         return $this->redirect($url);
     }
     // ZCommonFun::print_r_debug($post_data);
     // exit;
     return $this->render('step4', ['model_SurveyResulte' => $model_SurveyResulte, 'a_SurveyResulte' => $a_SurveyResulte, 'tax' => $model->tax, 'model' => $model]);
 }