积分兑换的小问题
来源:15-22 前端展示系统补强之奖品详情页的开发
杰哥大大
2018-03-03
当用户进行积分兑换奖品后operator_id为null,进去积分兑换记录的页面,无法显示operator是_id为空的兑换记录。我想问,在兑换未领取时,有给operatorid值吗?还是我dao层的select没写好
写回答
3回答
-
<select id="queryUserAwardMapList" resultMap="userAwardResultMap"> SELECT uam.user_award_id, uam.create_time, uam.used_status, uam.point, buyer.user_id, buyer.name, s.shop_id, s.shop_name, a.award_id, a.award_name, uam.operator_id AS operator_id FROM tb_user_award_map uam, tb_person_info buyer, tb_shop s, tb_award a <where> uam.user_id = buyer.user_id and uam.shop_id = s.shop_id and uam.award_id = a.award_id <!-- 按顾客信息精确查询 --> <if test="userAwardCondition.user!=null and userAwardCondition.user.userId!=null"> and uam.user_id = #{userAwardCondition.user.userId} </if> <!-- 按某个店铺精确查询 --> <if test="userAwardCondition.shop!=null and userAwardCondition.shop.shopId!=null"> and uam.shop_id = #{userAwardCondition.shop.shopId} </if> <!-- 按顾客名字模糊查询 --> <if test="userAwardCondition.user!=null and userAwardCondition.user.name!=null"> and buyer.name like '%${userAwardCondition.user.name}%' </if> <!-- 按奖品名模糊查询 --> <if test="userAwardCondition.award!=null and userAwardCondition.award.awardName!=null"> and a.award_name like '%${userAwardCondition.award.awardName}%' </if> <!-- 按奖品可用状态查询 --> <if test="userAwardCondition.usedStatus!=null"> and uam.used_status = #{userAwardCondition.usedStatus} </if> </where> ORDER BY uam.create_time desc LIMIT #{rowIndex},#{pageSize}; </select>
queryUserAwardMapList这个方法里,原先咱们把where 里面也加了operator_id = operator_id的判断,现在去除了,这样就不用去连接personinfo找operator了,不然会查不出来
032018-03-03 -
翔仔
2018-03-03
同学好,这里确实是有这么个小瑕疵,已在最终代码里修正,同学可以对比一下:) 当时确实是operator_id为空就显示不了,讲的内容太多,难免会有瑕疵,望同学海涵和指正:)
052018-03-03 -
杰哥大大
提问者
2018-03-03
是在用户兑换是给上operatorid值,还是在扫码时给的?
00
相似问题