动态的表格数据

动态的表格数据

动态的获取标题内容,

<thead>
        <tr>
            <th style=" auto;min- 101px;">商品名称(单位)</th>
            <volist name="result['user_list']" >
            <th style=" auto;min- 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 >
        <volist name="result['product_list']" >
            <tr data->
                <td>{$vo.title}</td>
                <volist name="result['user_list']" >
                    <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>