栏目模型绑定问题的bug

This commit is contained in:
2017-10-10 09:54:07 +08:00
parent 8cf272a615
commit 1517906f7b

View File

@@ -596,15 +596,11 @@ function parse_field_attr($string) {
function parse_field_bind($table, $selected = '', $model = 0) { function parse_field_bind($table, $selected = '', $model = 0) {
$list = array(); $list = array();
if ($table) { if ($table) {
$select = db($table); $res = db($table)->select();
$res = $select->select();
foreach ($res as $key => $value) { foreach ($res as $key => $value) {
if ($model && $value['model']) { if (($model && $value['model_id'] && $value['model_id'] == $model) || $value['model_id'] == 0) {
$models = explode(',', $value['model']); $list[] = $value;
if (in_array($model, $models)) { } elseif(!$model) {
$list[] = $value;
}
} else {
$list[] = $value; $list[] = $value;
} }
} }