解决分类为空时报错
This commit is contained in:
@@ -583,6 +583,7 @@ function parse_field_attr($string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parse_field_bind($table, $selected = '', $model = 0) {
|
function parse_field_bind($table, $selected = '', $model = 0) {
|
||||||
|
$list = array();
|
||||||
if ($table) {
|
if ($table) {
|
||||||
$select = db($table);
|
$select = db($table);
|
||||||
$res = $select->select();
|
$res = $select->select();
|
||||||
@@ -600,8 +601,6 @@ function parse_field_bind($table, $selected = '', $model = 0) {
|
|||||||
$tree = new \com\Tree();
|
$tree = new \com\Tree();
|
||||||
$list = $tree->toFormatTree($list);
|
$list = $tree->toFormatTree($list);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$list = array();
|
|
||||||
}
|
}
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class Attribute extends Base{
|
|||||||
$value['option'] = parse_field_attr($value['extra']);
|
$value['option'] = parse_field_attr($value['extra']);
|
||||||
} elseif ($value['type'] == 'bind') {
|
} elseif ($value['type'] == 'bind') {
|
||||||
$extra = parse_field_bind($value['extra']);
|
$extra = parse_field_bind($value['extra']);
|
||||||
|
$option = array();
|
||||||
foreach ($extra as $k => $v) {
|
foreach ($extra as $k => $v) {
|
||||||
$option[$v['id']] = $v['title_show'];
|
$option[$v['id']] = $v['title_show'];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user