|
@@ -76,12 +76,16 @@ func MsgDetail(id int) (*map[string]interface{}, error) {
|
|
|
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) {
|
|
|
+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 "
|
|
|
str := ""
|
|
|
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 += " a.send_usergroup_name = '" + param.UserGroupName + "' and"
|
|
|
+ if param.UserGroupName == "自定义" {
|
|
|
+ str += " a.sign = 1 and"
|
|
|
+ } else {
|
|
|
+ str += " a.send_usergroup_name = '" + param.UserGroupName + "' and"
|
|
|
+ }
|
|
|
}
|
|
|
if param.MsgType != 0 {
|
|
|
str += " a.msg_type = " + strconv.Itoa(param.MsgType) + " and"
|
|
@@ -106,6 +110,10 @@ func MsgList(param *MsgListParam, isLookAllMsg, loginUserId int) (*[]map[string]
|
|
|
}
|
|
|
if isLookAllMsg == 0 {
|
|
|
str += " a.send_userid = " + strconv.Itoa(loginUserId) + " and"
|
|
|
+ } else {
|
|
|
+ if param.Creator != "" {
|
|
|
+ str += " a.send_name = " + loginUserName + " and"
|
|
|
+ }
|
|
|
}
|
|
|
if param.Phone != "" {
|
|
|
str += " b.register_phone like '%" + param.Phone + "%' and"
|