业务经理

微信扫描以上二维码

028-61286886

技术咨询

Ftable字段循环的时候 想分开循环用 if判断无效

迅睿框架 更新 2022-07-31 19:58:23 靠谱小青年


{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}

方案

  • 迅睿框架技术-岳老师 #1 · 2022-07-22 14:30:00
      {if $v==0}肯定是不能的,$v是数组,不能直接等于判断
  • 靠谱小青年 #2 · 2022-07-22 14:31:27
    迅睿框架技术-岳老师 那用什么 判断可以 实现呢 谢谢
  • 农村人 #3 · 2022-07-22 14:32:34
    {if in_array(0, $v)}
  • 靠谱小青年 #4 · 2022-07-22 14:37:19
    农村人 {php $mval = $t['canshu'];} {loop $mval $v} {if in_array(0, $v)} <td>{$v[1]}</td> <td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$v[4]}</td> <td>{$v[5]}</td> {else} 11111 {/if} {/loop}这样吗 无效呢 哪里错了吗 谢谢
  • 老豆 #5 · 2022-07-22 15:02:12
    表示v1到v5,有一个是0的才显示
  • 小黄人 18html #6 · 2022-07-22 15:09:48
    满意答案
    <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>
  • 靠谱小青年 #7 · 2022-07-31 19:58:23
    @小黄人 18html:完美 完美

迅睿系统漏洞

用户系统
用户系统(2026-11-24)
修复同步登录码可离线派生的高危问题:登录接口响应不再回传 passw...
AI连接器(MCP)
AI连接器(MCP)(2026-11-23)
1.修复发布部分参数; 2.增加存草稿等8个工具,累计提供41个工...
GeoSeo收录宝
GeoSeo收录宝(2026-11-23)
1 关键词域改造 「关键词」单页承载 词列表 + AI研词 + 分...
网站统计分析
网站统计分析 (2026-11-22)
1 新增「统计报告」与 PDF 导出:独立报告页,核心指标 + 趋势...
站群分站系统
站群分站系统(2026-11-22)
增加AI内容生成、一键任务(TDK+文章)、GEO体检。 草稿箱支持...
CMS内容同步复制
CMS内容同步复制(2026-11-21)
跨服务器不同模块入库修正
GeoSeo工具箱
GeoSeo工具箱(2026-11-21)
优化城市与巡检AI配置归一 优化GEO诊断多记录比对
表单系统
表单系统(2026-11-20)
修复多通知邮箱时只有第一个能收到的问题 拆分邮箱时去掉空格/中文分隔...
Word导入编辑器
Word导入编辑器(2026-11-20)
插件设置页「创建上传字段方法」改为按内容模块一键创建: 自动在自定义...
微信系统
微信系统(2026-11-19)
修复关键词自动回复:填写规则名称后保存仍提示「请填写规则名称」