自定义表单优化

This commit is contained in:
2020-03-25 10:40:32 +08:00
parent 92cfb07097
commit 801a127871
19 changed files with 60470 additions and 23 deletions

View File

@@ -57,6 +57,22 @@ class FormAttr extends Base{
return $type_text[0];
}
protected function getExtraListAttr($value, $data){
$extra = [];
if ($data['extra']) {
$e = explode("\r\n", $data['extra']);
foreach ($e as $key => $value) {
if (strrpos($value, ":")) {
list($k, $v) = explode(":", $value);
$extra[] = ['key'=> $k, 'label' =>$v];
}else{
$extra[] = ['key'=> $key, 'label' =>$value];
}
}
}
return $extra;
}
public function getFieldlist($map,$index='id'){
$list = array();
$row = $this->field('*,remark as help,type,extra as "option"')->where($map)->order('group_id asc, sort asc')->select();