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

下线人数

上级 df9bfebd
......@@ -210,4 +210,11 @@ public class TbCfUserInfoController {
return R.ok();
}
@GetMapping("/getUserNetwork/{userId}")
@ResponseBody
public R getUserNetwork(@PathVariable String userId) {
List<TbCfUserInfoEntity> networks = tbCfUserInfoService.getUserNetwork(userId);
return R.ok().put("list",networks);
}
}
......@@ -48,4 +48,8 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
int countUser(@Param("account") String account, @Param("avatar") String avatar, @Param("nick") String nick);
String selectRandomUser();
List<TbCfUserInfoEntity> getUserNetwork(String userId);
int getUserNetworkCount(String userId);
}
......@@ -105,6 +105,8 @@ public class TbCfUserInfoEntity implements Serializable {
private Integer real;
private Integer network;
public Integer getReal() {
return real;
}
......@@ -422,4 +424,12 @@ public class TbCfUserInfoEntity implements Serializable {
public Integer getEmailFlag() {
return emailFlag;
}
public Integer getNetwork() {
return network;
}
public void setNetwork(Integer network) {
this.network = network;
}
}
......@@ -102,4 +102,6 @@ public interface TbCfUserInfoService {
void importData(MultipartFile multipartFile);
void exportData();
List<TbCfUserInfoEntity> getUserNetwork(String userId);
}
......@@ -37,7 +37,12 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
@Override
public List<TbCfUserInfoEntity> queryList(Map<String, Object> map) {
return tbCfUserInfoDao.queryList(map);
List<TbCfUserInfoEntity> users = tbCfUserInfoDao.queryList(map);
users.stream().forEach(user -> {
//查询下线人数
user.setNetwork(tbCfUserInfoDao.getUserNetworkCount(user.getUserId()));
});
return users;
}
@Override
......@@ -210,6 +215,11 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
}
@Override
public List<TbCfUserInfoEntity> getUserNetwork(String userId) {
return tbCfUserInfoDao.getUserNetwork(userId);
}
/**
* 编码文件名
*/
......
......@@ -173,7 +173,7 @@
c.user_id
WHERE 1=1 and `real` is null
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
AND account LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
......@@ -202,7 +202,7 @@
select count(*) from tb_cf_user_info
WHERE 1=1 and `real` is null
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
AND account LIKE concat('%',#{name},'%')
</if>
</select>
......@@ -337,4 +337,13 @@
<select id="selectRandomUser" resultType="string">
SELECT user_id FROM `tb_cf_user_info` WHERE `real` = 0 ORDER BY RAND() LIMIT 1;
</select>
<!--查看用户的下线-->
<select id="getUserNetwork" resultType="com.platform.entity.TbCfUserInfoEntity">
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 id="getUserNetworkCount" resultType="int">
select count(1) from network where user_info_user_id=#{userId}
</select>
</mapper>
......@@ -7,7 +7,7 @@
#jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root
jdbc.password: Diaoyunnuli.8
......
......@@ -7,7 +7,7 @@
#jdbc.password=diaoyun666
jdbc.url: jdbc:mysql://159.138.48.71:3306/test?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username: root
jdbc.password: Diaoyunnuli.8
......
......@@ -4,9 +4,10 @@
<title>用户表</title>
#parse("sys/header.html")
<style>
.ui-jqgrid .ui-jqgrid-bdiv{
height:auto!important;
.ui-jqgrid .ui-jqgrid-bdiv {
height: auto !important;
}
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
border-top: 2px solid #e7eaec;
line-height: 1.38857;
......@@ -107,7 +108,8 @@
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>
返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
......
......@@ -10,6 +10,7 @@ $(function () {
{label: '注册来源', name: 'source', index: 'source', width: 60, formatter: signTypeFormat},
{label: '用户头像地址', name: 'avatar', index: 'avatar', width: 100, formatter: imageFormat},
{label: '用户名', name: 'nick', index: 'nick', width: 80},
{label: '下线人数', name: 'network', index: 'network', width: 80},
{label: '下单次数', name: 'count', index: 'count', width: 80},
{label: '总金额', name: 'total', index: 'total', width: 80, formatter: moneyFormat},
{label: '使用优惠券次数', name: 'num', index: 'num', width: 80},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论