栏目模型绑定问题的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) {
$list = array();
if ($table) {
$select = db($table);
$res = $select->select();
$res = db($table)->select();
foreach ($res as $key => $value) {
if ($model && $value['model']) {
$models = explode(',', $value['model']);
if (in_array($model, $models)) {
$list[] = $value;
}
} else {
if (($model && $value['model_id'] && $value['model_id'] == $model) || $value['model_id'] == 0) {
$list[] = $value;
} elseif(!$model) {
$list[] = $value;
}
}