Пример #1
0
 /**
  * (string) actionIndex : marryList
  * @param $pid personal_id
  * @return string
  */
 public function actionIndex($pid)
 {
     /*Personal*/
     $personal = Personal::getPersonalByPid($pid);
     if (!$personal) {
         die('参数错误..');
     }
     $code1 = $personal->code1;
     $because = $personal->marry;
     $becausedate = $personal->marrydate;
     switch ($because) {
         case '22':
             $becausedate = $personal->zhdate;
             break;
         case '23':
             $becausedate = $personal->fhdate;
             break;
         case '30':
         case '40':
             $becausedate = $personal->lhdate;
             break;
     }
     /*配置参数*/
     $preferences = [];
     $preferencesForDT = [];
     $preferences['marry'] = Preferences::getByClassmark('pmarry');
     $preferences['hkxz'] = Preferences::getByClassmark('chkxz');
     $preferencesForDT['marry'] = Preferences::getByClassmarkForDatatables('pmarry');
     $preferencesForDT['hkxz'] = Preferences::getByClassmarkForDatatables('chkxz');
     return $this->render('index', ['pPrimaryKey' => $personal->id, 'pid' => $pid, 'id' => Marry::generateId($pid), 'code1' => $code1, 'because' => $because, 'becausedate' => $becausedate, 'selfno' => $personal->selfno, 'preferences' => Json::encode($preferences), 'preferencesForDT' => Json::encode($preferencesForDT)]);
 }