提交 afe371c1 authored 作者: 吴德鹏's avatar 吴德鹏

用户佣金

上级 bd76f076
...@@ -5,6 +5,7 @@ import com.platform.entity.VirtualUserEntity; ...@@ -5,6 +5,7 @@ import com.platform.entity.VirtualUserEntity;
import com.platform.vo.StatisticalVo; import com.platform.vo.StatisticalVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -52,4 +53,6 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> { ...@@ -52,4 +53,6 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
List<TbCfUserInfoEntity> getUserNetwork(String userId); List<TbCfUserInfoEntity> getUserNetwork(String userId);
int getUserNetworkCount(String userId); int getUserNetworkCount(String userId);
BigDecimal getUserBonus(String userId);
} }
...@@ -3,6 +3,7 @@ package com.platform.entity; ...@@ -3,6 +3,7 @@ package com.platform.entity;
import sun.rmi.server.InactiveGroupException; import sun.rmi.server.InactiveGroupException;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -107,6 +108,8 @@ public class TbCfUserInfoEntity implements Serializable { ...@@ -107,6 +108,8 @@ public class TbCfUserInfoEntity implements Serializable {
private Integer network; private Integer network;
private BigDecimal bonus;
public Integer getReal() { public Integer getReal() {
return real; return real;
} }
...@@ -432,4 +435,12 @@ public class TbCfUserInfoEntity implements Serializable { ...@@ -432,4 +435,12 @@ public class TbCfUserInfoEntity implements Serializable {
public void setNetwork(Integer network) { public void setNetwork(Integer network) {
this.network = network; this.network = network;
} }
public BigDecimal getBonus() {
return bonus;
}
public void setBonus(BigDecimal bonus) {
this.bonus = bonus;
}
} }
...@@ -41,6 +41,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -41,6 +41,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
users.stream().forEach(user -> { users.stream().forEach(user -> {
//查询下线人数 //查询下线人数
user.setNetwork(tbCfUserInfoDao.getUserNetworkCount(user.getUserId())); user.setNetwork(tbCfUserInfoDao.getUserNetworkCount(user.getUserId()));
user.setBonus(tbCfUserInfoDao.getUserBonus(user.getUserId()));
}); });
return users; return users;
} }
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
SELECT SELECT
user_id, user_id,
count( order_id ) count, count( order_id ) count,
sum( total_price ) total sum( reality_pay ) total
FROM FROM
tb_cf_order tb_cf_order
WHERE WHERE
...@@ -343,7 +343,14 @@ ...@@ -343,7 +343,14 @@
SELECT user_id,account,avatar,nick,country,email,phone from tb_cf_user_info u inner join (select network_info_user_id from network where user_info_user_id=#{userId}) temp on u.user_id=temp.network_info_user_id SELECT user_id,account,avatar,nick,country,email,phone from tb_cf_user_info u inner join (select network_info_user_id from network where user_info_user_id=#{userId}) temp on u.user_id=temp.network_info_user_id
</select> </select>
<!--查看用户的下线人数-->
<select id="getUserNetworkCount" resultType="int"> <select id="getUserNetworkCount" resultType="int">
select count(1) from network where user_info_user_id=#{userId} select count(1) from network where user_info_user_id=#{userId}
</select> </select>
<!--查看用户的佣金-->
<select id="getUserBonus" resultType="decimal">
SELECT IFNULL(TRUNCATE(sum(amount),3),0) from bonus where user_info_user_id=#{userId}
</select>
</mapper> </mapper>
...@@ -593,7 +593,7 @@ stateFormat = function (cellvalue) { ...@@ -593,7 +593,7 @@ stateFormat = function (cellvalue) {
*/ */
statusFormat = function (cellvalue) { statusFormat = function (cellvalue) {
return cellvalue == 1 ? '正常' : cellvalue == 2?'隐藏':'已隐藏'; return cellvalue == 1 ? '正常' : cellvalue == 2 ? '隐藏' : '已隐藏';
}; };
/** /**
......
...@@ -10,6 +10,7 @@ $(function () { ...@@ -10,6 +10,7 @@ $(function () {
{label: '注册来源', name: 'source', index: 'source', width: 60, formatter: signTypeFormat}, {label: '注册来源', name: 'source', index: 'source', width: 60, formatter: signTypeFormat},
{label: '用户头像地址', name: 'avatar', index: 'avatar', width: 100, formatter: imageFormat}, {label: '用户头像地址', name: 'avatar', index: 'avatar', width: 100, formatter: imageFormat},
{label: '用户名', name: 'nick', index: 'nick', width: 80}, {label: '用户名', name: 'nick', index: 'nick', width: 80},
{label: '佣金', name: 'bonus', index: 'bonus', width: 80, formatter: moneyFormat},
{label: '下线人数', name: 'network', index: 'network', width: 80}, {label: '下线人数', name: 'network', index: 'network', width: 80},
{label: '下单次数', name: 'count', index: 'count', width: 80}, {label: '下单次数', name: 'count', index: 'count', width: 80},
{label: '总金额', name: 'total', index: 'total', width: 80, formatter: moneyFormat}, {label: '总金额', name: 'total', index: 'total', width: 80, formatter: moneyFormat},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论