Ejemplo n.º 1
0
 /**
  * 创建投票
  *
  * @return void
  * @author
  **/
 public function actionCreate($type = 'product')
 {
     //菜单权限检测
     Yii::$app->util->adminAuth() ? '' : $this->redirect('/admin/login');
     // Call func
     $model['poll_model'] = new Poll();
     $model['poll_stage01_model'] = new PollStage01();
     // 第一阶段(海选期)Model
     $model['poll_stage02_model'] = new PollStage02();
     // 第二阶段(评委)Model
     $model['poll_stage03_model'] = new PollStage03();
     // 第三阶段Model
     $model['poll_stage04_model'] = new PollStage04();
     // 第四阶段Model
     call_user_func_array([$this, "_create_{$type}"], $model);
     // Model
     $this->data['poll_model'] = $model['poll_model'];
     $this->data['poll_stage01_model'] = $model['poll_stage01_model'];
     $this->data['poll_stage02_model'] = $model['poll_stage02_model'];
     $this->data['poll_stage03_model'] = $model['poll_stage03_model'];
     $this->data['poll_stage04_model'] = $model['poll_stage04_model'];
     $this->data['poll_type_result'] = PollType::find()->where(['poll_type_show' => PollType::STATUS_ACTIVE])->all();
     return $this->render($this->data['view'], $this->data);
 }
Ejemplo n.º 2
0
 /**
  * undocumented function
  *
  * @return void
  * @author
  **/
 public function getType()
 {
     return $this->hasOne(PollType::className(), ['poll_type_id' => 'poll_type_id'])->inverseOf('poll');
 }