|
@@ -76,13 +76,13 @@ func MsgDetail(id int) (*map[string]interface{}, error) {
|
|
|
return nil, errors.New("查询出错")
|
|
|
}
|
|
|
|
|
|
-var Str = "a.id,a.send_usergroup_name,a.msg_type,a.title,a.content,a.send_mode,a.send_time,a.send_status,a.update_time,a.createtime,a.link,a.isdel,a.send_name,a.send_usergroup_id,a.sign,a.user_add_way,a.template_name"
|
|
|
+var Str = "a.send_usergroup_name,a.msg_type,a.title,a.content,a.send_mode,a.send_time,a.send_status,a.update_time,a.createtime,a.link,a.isdel,a.send_name,a.send_usergroup_id,a.sign,a.user_add_way,a.template_name"
|
|
|
|
|
|
//消息列表查询
|
|
|
func MsgList(param *MsgListParam, isLookAllMsg, loginUserId int, loginUserName string) (*[]map[string]interface{}, int) {
|
|
|
- sql := "SELECT " + Str + " FROM message_send_log as a LEFT JOIN sendmsg_customer_info as b on a.id = b.msg_id "
|
|
|
+ sql := "SELECT DISTINCT(a.id) " + Str + " FROM message_send_log as a LEFT JOIN sendmsg_customer_info as b on a.id = b.msg_id "
|
|
|
str := ""
|
|
|
- sqlc := "SELECT COUNt(*) FROM message_send_log as a LEFT JOIN sendmsg_customer_info as b on a.id = b.msg_id "
|
|
|
+ sqlc := "SELECT DISTINCT(COUNt(*)) FROM message_send_log as a LEFT JOIN sendmsg_customer_info as b on a.id = b.msg_id "
|
|
|
if param.UserGroupName != "" {
|
|
|
if param.UserGroupName == "自定义" {
|
|
|
str += " a.sign = 1 and"
|
|
@@ -115,7 +115,7 @@ func MsgList(param *MsgListParam, isLookAllMsg, loginUserId int, loginUserName s
|
|
|
str += " a.send_userid = " + strconv.Itoa(loginUserId) + " and"
|
|
|
} else {
|
|
|
if param.Creator != "" {
|
|
|
- str += " a.send_name = " + loginUserName + " and"
|
|
|
+ str += " a.send_name = '" + loginUserName + "' and"
|
|
|
}
|
|
|
}
|
|
|
if param.Phone != "" {
|