/** * (string) actionDetail : 右侧区域信息 * @return string * @throws NotFoundHttpException */ public function actionDetail() { //$this->layout = 'bank'; $id = Yii::$app->request->post('id', '%'); if ($id == '0' || $id == '@') { $id = '%'; } $name = Yii::$app->request->post('name', '计生管理系统'); $unit = new Unit(); $p_num = Personal::find()->where(['unit' => $id])->count(1); if ($unit->isParent($id) && $p_num <= 0) { return $this->renderAjax('_detail', ['parent' => $id, 'parentName' => $name, 'unitcode' => Unit::getMaxunitcode($id), 'isParent' => intval($this->findModel($id)->corpflag) < 5 ? "yes" : "no"]); } else { $preferences = []; $preferences['sex'] = Preferences::getByClassmark('psex'); $preferences['marry'] = Preferences::getByClassmark('pmarry'); $preferences['flag'] = Preferences::getByClassmark('pflag'); $preferences['work1'] = Preferences::getByClassmark('pwork1'); return $this->renderAjax('/personal/_list', ['parent' => $id, 'parentName' => $name, 'code1' => Personal::getMaxCode(), 'preferences' => Json::encode($preferences)]); } }