|
@@ -73,43 +73,49 @@ func MsgDetail(id int) (*map[string]interface{}, error) {
|
|
|
return nil, errors.New("查询出错")
|
|
|
}
|
|
|
|
|
|
-//var Str = "id,send_usergroup_name,msg_type,title,content,send_mode,send_time,send_status,update_time,createtime,link,isdel,send_name,send_usergroup_id"
|
|
|
+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"
|
|
|
|
|
|
//消息列表查询
|
|
|
func MsgList(param *MsgListParam, isLookAllMsg, loginUserId int) (*[]map[string]interface{}, int) {
|
|
|
- sql := "SELECT * FROM message_send_log "
|
|
|
+ sql := "SELECT " + 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 "
|
|
|
+ sqlc := "SELECT COUNt(*) FROM message_send_log as a LEFT JOIN sendmsg_customer_info as b on a.id = b.msg_id "
|
|
|
if param.UserGroupName != "" {
|
|
|
- str += " send_usergroup_name = '" + param.UserGroupName + "' and"
|
|
|
+ str += " a.send_usergroup_name = '" + param.UserGroupName + "' and"
|
|
|
}
|
|
|
if param.MsgType != 0 {
|
|
|
- str += " msg_type = " + strconv.Itoa(param.MsgType) + " and"
|
|
|
+ str += " a.msg_type = " + strconv.Itoa(param.MsgType) + " and"
|
|
|
}
|
|
|
if param.Title != "" {
|
|
|
- str += " title like " + "'%" + param.Title + "%' and"
|
|
|
+ str += " a.title like " + "'%" + param.Title + "%' and"
|
|
|
}
|
|
|
if param.SendStatus != 0 {
|
|
|
- str += " send_status = " + strconv.Itoa(param.SendStatus) + " and"
|
|
|
+ str += " a.send_status = " + strconv.Itoa(param.SendStatus) + " and"
|
|
|
}
|
|
|
if param.SendTimeStart != "" {
|
|
|
- str += " send_time >= '" + param.SendTimeStart + " 00:00:00" + "' and"
|
|
|
+ str += " a.send_time >= '" + param.SendTimeStart + " 00:00:00" + "' and"
|
|
|
}
|
|
|
if param.SendTimeEnd != "" {
|
|
|
- str += " send_time <= '" + param.SendTimeEnd + " 23:59:59" + "' and"
|
|
|
+ str += " a.send_time <= '" + param.SendTimeEnd + " 23:59:59" + "' and"
|
|
|
}
|
|
|
if param.UpdateTimeStart != "" {
|
|
|
- str += " update_time >= '" + param.UpdateTimeStart + " 00:00:00" + "' and"
|
|
|
+ str += " a.update_time >= '" + param.UpdateTimeStart + " 00:00:00" + "' and"
|
|
|
}
|
|
|
if param.UpdateTimeEnd != "" {
|
|
|
- str += " update_time <= '" + param.UpdateTimeEnd + " 23:59:59" + "' and"
|
|
|
+ str += " a.update_time <= '" + param.UpdateTimeEnd + " 23:59:59" + "' and"
|
|
|
}
|
|
|
if isLookAllMsg == 0 {
|
|
|
- str += " send_userid = " + strconv.Itoa(loginUserId) + " and"
|
|
|
+ str += " a.send_userid = " + strconv.Itoa(loginUserId) + " and"
|
|
|
}
|
|
|
- page := " order by id desc limit " + fmt.Sprint(param.Page.Offset) + " " + "," + " " + fmt.Sprint(param.Page.PageSize)
|
|
|
- sql += " WHERE isdel = 1 and"
|
|
|
- sqlc += " WHERE isdel = 1 and"
|
|
|
+ if param.Phone != "" {
|
|
|
+ str += " b.register_phone like '%" + param.Phone + "%' and"
|
|
|
+ }
|
|
|
+ if param.UserId != "" {
|
|
|
+ str += " b.user_id like '%" + param.Phone + "%' and"
|
|
|
+ }
|
|
|
+ page := " order by a.id desc limit " + fmt.Sprint(param.Page.Offset) + " " + "," + " " + fmt.Sprint(param.Page.PageSize)
|
|
|
+ sql += " WHERE a.isdel = 1 and"
|
|
|
+ sqlc += " WHERE a.isdel = 1 and"
|
|
|
if str != "" {
|
|
|
str = str[:len(str)-3]
|
|
|
sql += str
|
|
@@ -824,6 +830,7 @@ func pushMsg(param *SendMessage, sendStatus int) (int, error) {
|
|
|
"link": param.Link,
|
|
|
"isdel": 1,
|
|
|
"send_userid": "hjzx", //呼叫中心
|
|
|
+ "sign": 3,
|
|
|
})
|
|
|
msgLogId = strconv.FormatInt(msgId, 10)
|
|
|
//立即发送
|