| 插件 | API接口 V7.8 |
| 应用作者 | 迅睿官方团队 |
| 发布时间 | 2019-03-14 09:57:26 |
| 更新时间 | 2025-03-06 07:21:54 |
{php $db = \Phpcmf\Service::M()->db;}
{table table=1_form_zwjhfb status=1 order=inputtime}
{php $api[$key]['id']=$t['id'];}
{php $api[$key]['title']=$t['title'];}
{php $api[$key]['xyzw']=$t['xyzw'];}
{php $api[$key]['xyrs'] = $db->table('dr_1_form_zwjhxxb')->where('bsqzw_id',$t['id'])->count() ?: 0;}
{php $api[$key]['inputtime']=dr_date($t['inputtime'], 'Y-m-d H:i');}
{/table}
这个是自定义模板标签,这里报错了。通过一张表里字段作为条件去查询另一张表的数量
{php $api[$key]['xyrs'] = $db->table('dr_1_form_zwjhxxb')->where('bsqzw_id',$t['id'])->count() ?: 0;}
