栏目模型绑定问题的bug
This commit is contained in:
@@ -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']);
|
|
||||||
if (in_array($model, $models)) {
|
|
||||||
$list[] = $value;
|
$list[] = $value;
|
||||||
}
|
} elseif(!$model) {
|
||||||
} else {
|
|
||||||
$list[] = $value;
|
$list[] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user