Ftable字段循环的时候 想分开循环用 if判断无效
{php $mval = $t['canshu'];}
{loop $mval $v}
<td>{$v[1]}</td>
<td>{$v[2]}</td>
{/loop}
Ftable 字段 循环的时候 想 分开 循环 用 if 判断无效 谢谢
{php $mval = $t['canshu'];}
{loop $mval $v}
{if $v==0}
<td>{$v[1]}</td>
<td>{$v[2]}</td>
{else}
<td class="hjk">{$v[1]}</td>
<td class="hjk">{$v[2]}</td>
{/if}
{/loop}
{php $mval = $t['canshu'];}
{loop $mval $v}
<td>{$v[1]}</td>
<td>{$v[2]}</td>
{/loop}
{if $v==0}肯定是不能的,$v是数组,不能直接等于判断<p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{php $mval = $t['canshu'];}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{loop $mval $k $v}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><span style="box-sizing: border-box; white-space: pre;"> </span>{if $k==0}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td>{$v[1]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td>{$v[2]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{else}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td class="hjk">{$v[1]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td class="hjk">{$v[2]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{/if}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{/loop}</p>