|
@@ -82,7 +82,9 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
|
|
|
data = util.Mysql.SelectBySql(customerSql)
|
|
|
customerMessageId := util.Inhandle(data)
|
|
|
//用户的列表
|
|
|
- sqlStr = fmt.Sprintf("SELECT IF ( b.nickname = '', CONCAT(SUBSTR( b.phone, 1, 3 ),'****',SUBSTR( b.phone, 8, 11)), b.nickname ) AS name, b.id, e.title, b.headimg, e.type, e.link, e.content, 2 AS userType, a.create_time, a.type AS itemType, "+
|
|
|
+ sqlStr = fmt.Sprintf("SELECT "+
|
|
|
+ "( CASE WHEN SUBSTR( b.nickname, 1, 3 ) = 'JY_' THEN CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) WHEN b.nickname = '' THEN CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) ELSE b.nickname END )"+
|
|
|
+ "AS name, b.id, e.title, b.headimg, e.type, e.link, e.content, 2 AS userType, a.create_time, a.type AS itemType, "+
|
|
|
"( SELECT count( h.id ) FROM %s h "+
|
|
|
"WHERE h.type = 2 "+
|
|
|
"AND h.own_id = %d "+
|
|
@@ -143,7 +145,9 @@ func (b MessaggeService) UserList(in *messagecenter.UserReq) (data *[]map[string
|
|
|
if data != nil {
|
|
|
customerMessageId := util.Inhandle(data)
|
|
|
//客服的用户列表
|
|
|
- sqlStr = fmt.Sprintf("SELECT IF ( b.nickname = '', CONCAT(SUBSTR( b.phone, 1, 3 ),'****',SUBSTR( b.phone, 8, 11)), b.nickname ) AS name, b.id, e.title, b.headimg, e.type, e.link, e.content, a.create_time, "+
|
|
|
+ sqlStr = fmt.Sprintf("SELECT "+
|
|
|
+ "( CASE WHEN SUBSTR( b.nickname, 1, 3 ) = 'JY_' THEN CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) WHEN b.nickname = '' THEN CONCAT( SUBSTR( b.phone, 1, 3 ), '****', SUBSTR( b.phone, 8, 11 ) ) ELSE b.nickname END )"+
|
|
|
+ " AS name, b.id, e.title, b.headimg, e.type, e.link, e.content, a.create_time, "+
|
|
|
"( SELECT count( h.id ) FROM %s h "+
|
|
|
"LEFT JOIN %s i ON h.own_type = 1 AND h.own_id = i.id "+
|
|
|
"WHERE h.own_type = 1 "+
|