💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### showDatadicts **设置页面数据字典项** **参数** 传入的数组key为页面上设置的模板字符串,value为后台设置的父亲code $parentCodeArr : 数据字典编码数组 $keyCode : 需要转换的数据 $emptyOption : true/false 是否加入一个空的option $$conditionArr: 查找条件数组 ~~~ function showDatadicts($parentCodeArr, $keyCode = null, $emptyOption = false ,$conditionArr = null) { if (is_array ( $parentCodeArr )) { $datadictArr = $this->getDatadicts ( $parentCodeArr ,$conditionArr); //print_r($datadictArr); foreach ( $datadictArr as $key => $valueArr ) { $str = ""; if ($emptyOption) { $str .= ""; } if (is_array ( $valueArr )) { foreach ( $valueArr as $k => $v ) { $eStr = 'e1="' . $v ['expand1'] . '" e2="' . $v ['expand2'] . '" e3="' . $v ['expand3'] . '" e4="' . $v ['expand4'] . '" e5="' . $v ['expand5'] . '"'; if ($v ['dataCode'] == $keyCode) $str .= ''; else $str .= ''; $str .= $v ['dataName']; $str .= ''; } } $k = array_search ( $key, $parentCodeArr ); $this->show->assign ( $k == false ? $key : $k, $str ); } } } ~~~ **例:** ~~~ ... ... $this->showDatadicts(array ('contractType' => 'HTLX'), $obj['contractType']); ... ... ~~~