动态的表格数据

动态的获取标题内容,

<thead>
        <tr>
            <th style="width: auto;min-width: 101px;">商品名称(单位)</th>
            <volist name="result['user_list']" id="vo">
            <th style="width: auto;min-width: 100px;">{$vo['name']}
                <notempty name="vo['remark']">
                    ({$vo['remark']})
                </notempty>
            </th>
            </volist>
        </tr>
</thead>

以产品为基调,动态的获取标题栏对应的底部内容,

// 分门别类处理
foreach ($product_list as $pk=>&$pv) {
    $pv['title'] = $pv['title'] . '(' . $pv['unit'] . ')';
    foreach ($user_list as $uk => $uv) {
        if ($user_product_count[$uv['id'] . '_' . $pv['id']]) {
            $pv[$uv['id']] = $user_product_count[$uv['id'] . '_' . $pv['id']];
        } else {
            $pv[$uv['id']] = 0;
        }
    }
}

处理数据展示,

<tbody id="tbody">
        <volist name="result['product_list']" id="vo">
            <tr data-id="{$vo.id}">
                <td>{$vo.title}</td>
                <volist name="result['user_list']" id="uvo">
                    <td>
                        <notempty name="vo[$uvo['id']]">
                            <span style="font-weight: bold;font-size: 16px;">{$vo[$uvo['id']]}</span>
                            <else />
                            {$vo[$uvo['id']]}
                        </notempty>

                    </td>
                </volist>
            </tr>
        </volist>
</tbody>
posted @ 2019-04-30 17:32  TBHacker  阅读(263)  评论(0编辑  收藏  举报