修复一处bug

This commit is contained in:
2017-10-23 11:16:13 +08:00
parent d660451431
commit 83278d8764
2 changed files with 2 additions and 2 deletions

View File

@@ -46,7 +46,7 @@
<div class="col-lg-5"> <div class="col-lg-5">
<select name="pid" class="form-control" style="width:auto;"> <select name="pid" class="form-control" style="width:auto;">
<option value="0">--一级导航--</option> <option value="0">--一级导航--</option>
{volist name=":parse_field_bind('Channel',$info['pid'],'')" id="item"} {volist name=":parse_field_bind('Channel',$info['pid'], 0)" id="item"}
{if condition="$item['id'] neq $info['id']"} {if condition="$item['id'] neq $info['id']"}
<option value="{$item['id']}" {if condition="$pid eq $item['id']"}selected{/if}>{$item['title_show']}</option> <option value="{$item['id']}" {if condition="$pid eq $item['id']"}selected{/if}>{$item['title_show']}</option>
{/if} {/if}

View File

@@ -598,7 +598,7 @@ function parse_field_bind($table, $selected = '', $model = 0) {
if ($table) { if ($table) {
$res = db($table)->select(); $res = db($table)->select();
foreach ($res as $key => $value) { foreach ($res as $key => $value) {
if (($model && $value['model_id'] && $value['model_id'] == $model) || $value['model_id'] == 0) { if (($model && isset($value['model_id']) && $value['model_id'] == $model) || (isset($value['model_id']) && $value['model_id'] == 0)) {
$list[] = $value; $list[] = $value;
} elseif(!$model) { } elseif(!$model) {
$list[] = $value; $list[] = $value;