mybatis layui实现 一对一关联表查询界面数据显示

解决界面显示关联表数据属性

templet:’
{{d(这个d固定的).productCategory(哪个表).categoryId(哪个属性)}}

  table.render({
            elem: '#demo'
            ,height: 420
            ,url: '/pall' //数据接口
            ,title: '操作记录表'
            ,page: true //开启分页
            ,toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
            ,totalRow: false //开启合计行
            ,cols: [[ //表头
                {type: 'checkbox', fixed: 'left' }
                ,{field: 'productId', title: '商品ID', width:80, sort: true, fixed: 'left'}
                ,{field: 'productName', title: '商品名', width: 90, sort: true, totalRow: true}
                ,{field: 'productPrice', title: '商品价格', width:80, sort: true}
                ,{field: 'productDescription', title: '商品描述', width:80, sort: true}
                ,{templet:'<div>{{d.productCategory.categoryId}}</div>',title: '分类ID', width: 200, }
                ,{title: '分类名', width:150,templet:'<div>{{d.productCategory.categoryName}}</div>'}
                ,{title: '分类编号', width:150,templet:'<div>{{d.productCategory.categoryNumber}}</div>'}
                ,{fixed: 'right', width: 165, align:'center', toolbar: '#barDemo',}
            ]]
        });

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值