Commit dba49a5f authored by 罗林杰's avatar 罗林杰

修改充值查询

parent 7e1f0d48
......@@ -34,5 +34,7 @@ public interface MemGoldCoinFlowRepository extends CyBaseMapper<MemGoldCoinFlow>
* 查询当前用户金币余额
*/
Integer balance(Integer userId);
int insertMemGoldCoinFlow(@Param("entity") MemGoldCoinFlow memGoldCoinFlow);
}
......@@ -47,9 +47,8 @@ public class MemGoldCoinFlowServiceImpl extends ServiceImpl<MemGoldCoinFlowRepos
public CyPersistModel persist(MemGoldCoinFlow memGoldCoinFlow){
//增加到金币流水表
memGoldCoinFlow.setEndCount(memGoldCoinFlow.getCount() + memGoldCoinFlow.getBalance());
//修改创建人,方便小程序查询消费记录
memGoldCoinFlow.setCreateBy(String.valueOf(memGoldCoinFlow.getTargetId()));
int line = baseMapper.insert(memGoldCoinFlow);
int line = baseMapper.insertMemGoldCoinFlow(memGoldCoinFlow);
//修改会员表的金币余额
MemInfo memInfo = new MemInfo();
memInfo.setBusinessId(memGoldCoinFlow.getMemberId());
......
......@@ -53,6 +53,7 @@
left join sys_user su on su.business_id = mgcf.target_id
where 1=1
and mgcf.del_flag = '0'
and mgcf.create_by = #{entity.targetId}
<if test="entity.beginTime !=null and entity.beginTime != '' ">
and mgcf.create_date &gt;= #{entity.beginTime}
</if>
......@@ -77,9 +78,6 @@
<if test="entity.orderId !=null and entity.orderId != '' ">
and order_id = #{entity.orderId}
</if>
<if test="entity.targetId !=null and entity.targetId != '' ">
and target_id = #{entity.targetId}
</if>
<if test="entity.userNickName !=null and entity.userNickName != '' ">
and su.nick_name like concat('%',#{entity.userNickName},'%')
</if>
......@@ -109,4 +107,10 @@
from mem_info mi
where user_id = #{userId}
</select>
<insert id="insertMemGoldCoinFlow">
insert into mem_gold_coin_flow
(create_by, create_date, update_by, update_date, flag,del_flag, type, action_type, count, end_count, target_id)
values
(#{entity.targetId}, now(), #{entity.targetId}, now(), #{entity.flag},#{entity.delFlag} , #{entity.type}, #{entity.actionType}, #{entity.count}, #{entity.endCount}, #{entity.targetId})
</insert>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment