el表达式遍历订单和商品订单的问题?

本人用ssm写的项目,有个问题卡着了,我的订单下面有好几个商品,但是遍历的时候只遍历出来一个商品,剩下的不显示了,不知道要怎么写才能显示出来,求大佬帮看下,谢谢啦!一对多查询的mybatis的sql语句订单表的数据商品订单表数据el表达式遍历页面el表达式遍历的页面效果
已解决!
本人在订单商品表加了商品表和规格表的私有属性
图片说明
直接打点调用订单商品表的字段就行了图片说明
订单表图片说明
```

                                <tr class="hd order-meta">
                                    <td colspan="4">
                                        <div class="left">下单时间:${order.buyTime} 订单号: ${order.orderNumber}</div>
                                        <div class="right"> <span class="del iconfont icon-shanchu"></span></div>
                                    </td>
                                </tr>
                                <tr class="order-goods">
                                    <td>
                                        <c:forEach items="${order.orderPro}" var="o">
                                            <div class="goods-info">
                                                <img class="figure" src="uploads/${o.proPicture}" alt="" />
                                                <!-- <a class="text-info refund" href="uc-apply-refund.jsp">申请退货</a> -->
                                                <div class="info">
                                                    <div>${o.proName} ${o.color} ${o.memory}</div>
                                                    <div>${o.price}元*${o.count}</div>
                                                </div>
                                            </div>
                                        </c:forEach>
                                    </td>
                                    <td>
                                        总金额:<span class="text-theme fwb">${order.totalMoney}.00元</span>
                                    </td>
                                    <c:if test="${order.state=='待付款'}">
                                        <td>
                                            <a class="text-info" href="uc-order-detail.jsp">订单详情</a><br />
                                        </td>
                                        <td>
                                            <a href="" class="ui-btn-theme uc-btn-md">去付款</a>
                                            <a class="ui-btn-low ui-btn-hollow uc-btn-md mt10">${order.state}</a>
                                            <a href="" class="ui-btn-low ui-btn-hollow uc-btn-md mt10">取消订单</a>
                                        </td>
                                    </c:if>
                                    <c:if test="${order.state=='待发货'}">
                                        <td>
                                            <a class="text-info" href="uc-order-detail.jsp">订单详情</a><br />
                                        </td>
                                        <td>
                                            <a href="" class="ui-btn-theme uc-btn-md">提醒发货</a>
                                            <a href="" class="ui-btn-low ui-btn-hollow uc-btn-md mt10">${order.state}</a>
                                        </td>
                                    </c:if>
                                    <c:if test="${order.state=='待收货'}">
                                        <td>
                                            <a class="text-info" href="uc-order-detail.jsp">订单详情</a><br />
                                            <a class="text-info" href="">查看物流</a>
                                        </td>
                                        <td>
                                            <div class="time-left"><i class="iconfont icon-shijian"></i>还剩2天8时</div>
                                            <a href="" class="ui-btn-low ui-btn-hollow uc-btn-md mt10">${order.state}</a>
                                            <a href="" class="ui-btn-theme uc-btn-md">确认收货</a>
                                        </td>
                                    </c:if>
                                    <c:if test="${order.state=='待评价'}">
                                        <td>
                                            <span class="status">快件已签收</span><br />
                                            <a class="text-info" href="uc-order-detail.jsp">订单详情</a><br />
                                            <a class="text-info" href="">查看物流</a>
                                        </td>
                                        <td>
                                            <a href="" class="ui-btn-theme uc-btn-md">评价</a>
                                            <a href="" class="ui-btn-low ui-btn-hollow uc-btn-md mt10">${order.state}</a>
                                        </td>
                                    </c:if>
                                </tr>

                            </c:forEach>
<resultMap type="Order" id="myOrder">
        <id column="orderNumber" property="orderNumber" />
        <result column="aid" property="aid" />
        <result column="uid" property="uid" />
        <result column="totalMoney" property="totalMoney" />
        <result column="payType" property="payType" />
        <result column="payTime" property="payTime" />
        <result column="buyTime" property="buyTime" />
        <result column="finishTime" property="finishTime" />
        <result column="remark" property="remark" />
        <result column="state" property="state" />
        <collection property="pro" ofType="Product">
            <id column="id" property="id" />
            <result column="proName" property="proName" />
            <result column="proType" property="proType" />
            <result column="putaway" property="putaway" />
            <result column="proPicture" property="proPicture" />
        </collection>
        <collection property="orderPro" ofType="OrderProduct">
            <id column="id" property="id" />
            <result column="orderNumber" property="orderNumber" />
            <result column="pid" property="pid" />
            <result column="proName" property="proName" />
            <result column="proPicture" property="proPicture" />
            <result column="color" property="color" />
            <result column="memory" property="memory" />
            <result column="count" property="count" />
            <result column="price" property="price" />
        </collection>
        <collection property="spe" ofType="Specification">
            <id column="id" property="id" />
            <result column="pid" property="pid" />
            <result column="brand" property="brand" />
            <result column="color" property="color" />
            <result column="memory" property="memory" />
            <result column="storage" property="storage" />
            <result column="inventory" property="inventory" />
            <result column="originalPrice" property="originalPrice" />
            <result column="presentPrice" property="presentPrice" />
            <result column="saleVolume" property="saleVolume" />
        </collection>
        <collection property="a" ofType="Address">
        <id column="id" property="id" />
        <result column="uid" property="uid" />
        <result column="consignee" property="consignee" />
        <result column="phone" property="phone" />
        <result column="province" property="province" />
        <result column="city" property="city" />
        <result column="district" property="district" />
        <result column="detail" property="detail" />
        <result column="default1" property="default1" />
        </collection>
    </resultMap>

2个回答

你不都是已经用[0]来拿值了么,那就说明存在goodslist啊,那在里面把 goods-info 这个div循环一下

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问