Эх сурвалжийг харах

后台获取消息分类接口修改

renjiaojiao 2 жил өмнө
parent
commit
fb60ccd2b8

+ 5 - 0
src/customerService/newsController.go

@@ -199,6 +199,11 @@ func SendMessageApi(context *admin.Context) (interface{}, error) {
 func GetMsgType(context *admin.Context) (interface{}, error) {
 func GetMsgType(context *admin.Context) (interface{}, error) {
 	types := util.MessageDB.SelectBySql("SELECT msg_type,msg_name AS name,group_id FROM `message_class` WHERE background_send = 1 ")
 	types := util.MessageDB.SelectBySql("SELECT msg_type,msg_name AS name,group_id FROM `message_class` WHERE background_send = 1 ")
 	if types != nil && len(*types) > 0 {
 	if types != nil && len(*types) > 0 {
+		tp := []map[string]interface{}{}
+		for _, v := range *types {
+			v["msg_type"] = qutil.InterfaceToStr(v["msg_type"])
+			tp = append(tp, v)
+		}
 		return types, nil
 		return types, nil
 	}
 	}
 	return nil, errors.New("未查询到分类")
 	return nil, errors.New("未查询到分类")