|
@@ -37,7 +37,8 @@ type Action struct {
|
|
func (ac *Action) Subscribe_index() error {
|
|
func (ac *Action) Subscribe_index() error {
|
|
userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
entId := qutil.IntAll(ac.GetSession("entId"))
|
|
entId := qutil.IntAll(ac.GetSession("entId"))
|
|
- entInfo := VarCurrentUser.EntInfo(userId, entId)
|
|
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
subscribe := map[string]interface{}{}
|
|
subscribe := map[string]interface{}{}
|
|
result := map[string]interface{}{
|
|
result := map[string]interface{}{
|
|
"model": entInfo.Ent.Model,
|
|
"model": entInfo.Ent.Model,
|
|
@@ -135,7 +136,7 @@ func (ac *Action) Subscribe_index() error {
|
|
}
|
|
}
|
|
} else if model == 2 {
|
|
} else if model == 2 {
|
|
o_entniche, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
o_entniche, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
"i_entid": entId,
|
|
"i_entid": entId,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -204,20 +205,21 @@ func (ac *Action) Subscribe_index() error {
|
|
|
|
|
|
//区域
|
|
//区域
|
|
func (ac *Action) Get_area() error {
|
|
func (ac *Action) Get_area() error {
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
var res *map[string]interface{}
|
|
var res *map[string]interface{}
|
|
switch model {
|
|
switch model {
|
|
case 1:
|
|
case 1:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
case 2:
|
|
case 2:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if res == nil {
|
|
if res == nil {
|
|
@@ -266,7 +268,9 @@ func (ac *Action) Update_area() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
after_arr, only_area_arr := []string{}, []string{}
|
|
after_arr, only_area_arr := []string{}, []string{}
|
|
- entInfo := VarCurrentUser.EntInfo(qutil.ObjToString(ac.GetSession("userId")), qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
if len(area) > 0 {
|
|
if len(area) > 0 {
|
|
for k, v := range area {
|
|
for k, v := range area {
|
|
if len(v.([]interface{})) > 0 {
|
|
if len(v.([]interface{})) > 0 {
|
|
@@ -289,7 +293,7 @@ func (ac *Action) Update_area() {
|
|
distribute_area_map, distribute_area_new_map := map[string]interface{}{}, map[string]interface{}{}
|
|
distribute_area_map, distribute_area_new_map := map[string]interface{}{}, map[string]interface{}{}
|
|
list_items, _ := util.MQFW.Find(util.Entniche_distribute, map[string]interface{}{
|
|
list_items, _ := util.MQFW.Find(util.Entniche_distribute, map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
"i_status": 0,
|
|
"i_status": 0,
|
|
}, nil, nil, false, -1, -1)
|
|
}, nil, nil, false, -1, -1)
|
|
if len(*list_items) > 0 {
|
|
if len(*list_items) > 0 {
|
|
@@ -348,9 +352,10 @@ func (ac *Action) Update_area() {
|
|
|
|
|
|
//行业
|
|
//行业
|
|
func (ac *Action) Get_buyerclass() {
|
|
func (ac *Action) Get_buyerclass() {
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
data := []string{}
|
|
data := []string{}
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
// res, ok := util.MQFW.FindById("user", userId, `{"o_entniche.a_buyerclass":1}`)
|
|
// res, ok := util.MQFW.FindById("user", userId, `{"o_entniche.a_buyerclass":1}`)
|
|
var res *map[string]interface{}
|
|
var res *map[string]interface{}
|
|
@@ -358,12 +363,12 @@ func (ac *Action) Get_buyerclass() {
|
|
case 1:
|
|
case 1:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
case 2:
|
|
case 2:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if res == nil {
|
|
if res == nil {
|
|
@@ -403,11 +408,13 @@ func (ac *Action) Update_buyerclass() {
|
|
if bl {
|
|
if bl {
|
|
//分类名有分发规则
|
|
//分类名有分发规则
|
|
// distribute_buyerclass := []string{}
|
|
// distribute_buyerclass := []string{}
|
|
- entInfo := VarCurrentUser.EntInfo(qutil.ObjToString(ac.GetSession("userId")), qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
distribute_buyerclass_map, distribute_buyerclass_new_map := map[string]interface{}{}, map[string]interface{}{}
|
|
distribute_buyerclass_map, distribute_buyerclass_new_map := map[string]interface{}{}, map[string]interface{}{}
|
|
list_items, _ := util.MQFW.Find(util.Entniche_distribute, map[string]interface{}{
|
|
list_items, _ := util.MQFW.Find(util.Entniche_distribute, map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
"i_status": 0,
|
|
"i_status": 0,
|
|
}, nil, nil, false, -1, -1)
|
|
}, nil, nil, false, -1, -1)
|
|
if len(*list_items) > 0 {
|
|
if len(*list_items) > 0 {
|
|
@@ -446,8 +453,9 @@ func (ac *Action) Update_buyerclass() {
|
|
//信息类型
|
|
//信息类型
|
|
func (ac *Action) Get_infotype() {
|
|
func (ac *Action) Get_infotype() {
|
|
data := []string{}
|
|
data := []string{}
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
// res, ok := util.MQFW.FindById("user", userId, `{"o_entniche.a_infotype":1}`)
|
|
// res, ok := util.MQFW.FindById("user", userId, `{"o_entniche.a_infotype":1}`)
|
|
var res *map[string]interface{}
|
|
var res *map[string]interface{}
|
|
@@ -455,12 +463,12 @@ func (ac *Action) Get_infotype() {
|
|
case 1:
|
|
case 1:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
case 2:
|
|
case 2:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if len(*res) == 0 || res == nil {
|
|
if len(*res) == 0 || res == nil {
|
|
@@ -517,19 +525,21 @@ func (ac *Action) Get_key() {
|
|
}
|
|
}
|
|
delete(*res, "_id")
|
|
delete(*res, "_id")
|
|
//查看是否使用过快速导入
|
|
//查看是否使用过快速导入
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
var res_ *map[string]interface{}
|
|
var res_ *map[string]interface{}
|
|
switch model {
|
|
switch model {
|
|
case 1:
|
|
case 1:
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
case 2:
|
|
case 2:
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if res_ == nil {
|
|
if res_ == nil {
|
|
@@ -577,9 +587,9 @@ func (ac *Action) Get_key() {
|
|
|
|
|
|
//关键词{"_id" : ObjectId("5e69cd765484c8457bf06006")}
|
|
//关键词{"_id" : ObjectId("5e69cd765484c8457bf06006")}
|
|
func (ac *Action) Update_key() {
|
|
func (ac *Action) Update_key() {
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
entId := qutil.IntAll(ac.GetSession("entId"))
|
|
entId := qutil.IntAll(ac.GetSession("entId"))
|
|
- entInfo := VarCurrentUser.EntInfo(userId, entId)
|
|
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
status := 0 //0:失败,1:成功,-1:分类名重复,-2:关联有分发规则,不能删除
|
|
status := 0 //0:失败,1:成功,-1:分类名重复,-2:关联有分发规则,不能删除
|
|
keywords := map[string]interface{}{}
|
|
keywords := map[string]interface{}{}
|
|
distribute_item_map := map[string]interface{}{} //用来计算规则顺序
|
|
distribute_item_map := map[string]interface{}{} //用来计算规则顺序
|
|
@@ -684,19 +694,21 @@ func (ac *Action) Get_fastimport() {
|
|
a := map[string]int{} //分类 位置
|
|
a := map[string]int{} //分类 位置
|
|
b := map[string]bool{} //关键词
|
|
b := map[string]bool{} //关键词
|
|
//从entniche_rule中获取o_entniche
|
|
//从entniche_rule中获取o_entniche
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
var res_ *map[string]interface{}
|
|
var res_ *map[string]interface{}
|
|
switch model {
|
|
switch model {
|
|
case 1:
|
|
case 1:
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
case 2:
|
|
case 2:
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res_, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if res_ == nil {
|
|
if res_ == nil {
|
|
@@ -859,7 +871,7 @@ func (ac *Action) Get_fastimport() {
|
|
if model == 1 {
|
|
if model == 1 {
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
}, bson.M{
|
|
}, bson.M{
|
|
"$set": bson.M{
|
|
"$set": bson.M{
|
|
"o_entniche.a_items": b_items_ent,
|
|
"o_entniche.a_items": b_items_ent,
|
|
@@ -869,8 +881,8 @@ func (ac *Action) Get_fastimport() {
|
|
}, true, false)
|
|
}, true, false)
|
|
} else if model == 2 {
|
|
} else if model == 2 {
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
}, bson.M{
|
|
}, bson.M{
|
|
"$set": bson.M{
|
|
"$set": bson.M{
|
|
"o_entniche.a_items": b_items_ent,
|
|
"o_entniche.a_items": b_items_ent,
|
|
@@ -902,21 +914,22 @@ func (ac *Action) Update_projectmatch() {
|
|
//推送设置
|
|
//推送设置
|
|
func (ac *Action) Get_pushset() {
|
|
func (ac *Action) Get_pushset() {
|
|
data := map[string]interface{}{}
|
|
data := map[string]interface{}{}
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
// res, ok := util.MQFW.FindById("user", userId, `{"o_entniche.i_ratemode":1,"o_entniche.i_apppush":1,"o_entniche.i_mailpush":1,"o_entniche.i_matchway":1}`)
|
|
// res, ok := util.MQFW.FindById("user", userId, `{"o_entniche.i_ratemode":1,"o_entniche.i_apppush":1,"o_entniche.i_mailpush":1,"o_entniche.i_matchway":1}`)
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
var res *map[string]interface{}
|
|
var res *map[string]interface{}
|
|
switch model {
|
|
switch model {
|
|
case 1:
|
|
case 1:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
case 2:
|
|
case 2:
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
res, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if res == nil {
|
|
if res == nil {
|
|
@@ -938,8 +951,9 @@ func (ac *Action) Get_pushset() {
|
|
//推送设置
|
|
//推送设置
|
|
func (ac *Action) Update_pushset() {
|
|
func (ac *Action) Update_pushset() {
|
|
bl := false
|
|
bl := false
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
|
|
status := 0
|
|
status := 0
|
|
ratemode, _ := ac.GetInteger("ratemode")
|
|
ratemode, _ := ac.GetInteger("ratemode")
|
|
@@ -950,7 +964,7 @@ func (ac *Action) Update_pushset() {
|
|
case 1:
|
|
case 1:
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
}, bson.M{"$set": bson.M{
|
|
}, bson.M{"$set": bson.M{
|
|
"l_updatetime": time.Now().Unix(),
|
|
"l_updatetime": time.Now().Unix(),
|
|
`o_entniche.i_ratemode`: ratemode,
|
|
`o_entniche.i_ratemode`: ratemode,
|
|
@@ -960,8 +974,8 @@ func (ac *Action) Update_pushset() {
|
|
}}, true, false)
|
|
}}, true, false)
|
|
case 2:
|
|
case 2:
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
}, bson.M{"$set": bson.M{
|
|
}, bson.M{"$set": bson.M{
|
|
"l_updatetime": time.Now().Unix(),
|
|
"l_updatetime": time.Now().Unix(),
|
|
`o_entniche.i_ratemode`: ratemode,
|
|
`o_entniche.i_ratemode`: ratemode,
|
|
@@ -983,8 +997,8 @@ func (ac *Action) Subscribe_subdis() {
|
|
}
|
|
}
|
|
subdis, _ := ac.GetInteger("subdis")
|
|
subdis, _ := ac.GetInteger("subdis")
|
|
ent_id := qutil.IntAll(ac.GetSession("entId"))
|
|
ent_id := qutil.IntAll(ac.GetSession("entId"))
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
- entInfo := VarCurrentUser.EntInfo(userId, ent_id)
|
|
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(ent_id, entUserId)
|
|
status := 0
|
|
status := 0
|
|
if VarDepartment.SubDis(ent_id, entInfo.Dept.Id, subdis) {
|
|
if VarDepartment.SubDis(ent_id, entInfo.Dept.Id, subdis) {
|
|
status = 1
|
|
status = 1
|
|
@@ -1059,22 +1073,23 @@ func ReplaceValues(slice []string, before, after string) []string {
|
|
//修改或新增 entniche_rule 表的 entinfo 信息 parameter_name参数名 parameter参数
|
|
//修改或新增 entniche_rule 表的 entinfo 信息 parameter_name参数名 parameter参数
|
|
func (ac *Action) updateEntnicheRule(parameter_name string, parameter interface{}) bool {
|
|
func (ac *Action) updateEntnicheRule(parameter_name string, parameter interface{}) bool {
|
|
bl := false
|
|
bl := false
|
|
- userId := qutil.ObjToString(ac.GetSession("userId"))
|
|
|
|
- entInfo := VarCurrentUser.EntInfo(userId, qutil.IntAll(ac.GetSession("entId")))
|
|
|
|
|
|
+ entId := qutil.IntAll(ac.GetSession("entId"))
|
|
|
|
+ entUserId := qutil.IntAll(ac.GetSession("entUserId"))
|
|
|
|
+ entInfo := VarCurrentUser.EntInfo(entId, entUserId)
|
|
model := entInfo.Ent.Model //1-统一订阅(i_deptid i_entid) 2-个人订阅(i_userid i_entid)
|
|
model := entInfo.Ent.Model //1-统一订阅(i_deptid i_entid) 2-个人订阅(i_userid i_entid)
|
|
switch model {
|
|
switch model {
|
|
case 1:
|
|
case 1:
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
"i_deptid": entInfo.Dept.Id,
|
|
"i_deptid": entInfo.Dept.Id,
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_entid": entId,
|
|
}, bson.M{"$set": bson.M{
|
|
}, bson.M{"$set": bson.M{
|
|
"l_updatetime": time.Now().Unix(),
|
|
"l_updatetime": time.Now().Unix(),
|
|
"o_entniche." + parameter_name: parameter,
|
|
"o_entniche." + parameter_name: parameter,
|
|
}}, true, false)
|
|
}}, true, false)
|
|
case 2:
|
|
case 2:
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
bl = util.MQFW.Update("entniche_rule", bson.M{
|
|
- "i_userid": qutil.IntAll(ac.GetSession("entUserId")),
|
|
|
|
- "i_entid": qutil.IntAll(ac.GetSession("entId")),
|
|
|
|
|
|
+ "i_userid": entUserId,
|
|
|
|
+ "i_entid": entId,
|
|
}, bson.M{"$set": bson.M{
|
|
}, bson.M{"$set": bson.M{
|
|
"l_updatetime": time.Now().Unix(),
|
|
"l_updatetime": time.Now().Unix(),
|
|
"o_entniche." + parameter_name: parameter,
|
|
"o_entniche." + parameter_name: parameter,
|