From 1517906f7b0d6a2419c74b453f07884d56bd15fb Mon Sep 17 00:00:00 2001 From: molong Date: Tue, 10 Oct 2017 09:54:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E6=A8=A1=E5=9E=8B=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E9=97=AE=E9=A2=98=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/application/common.php b/application/common.php index ac94a3db..f6a6b78b 100644 --- a/application/common.php +++ b/application/common.php @@ -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; } }