Browse Source

Merge branch 'master' of https://app.yhyue.com/moapp/jypkg

wangchuanjin 2 years ago
parent
commit
c14ab6d081
2 changed files with 21 additions and 9 deletions
  1. 6 8
      common/src/qfw/util/dataexport/common.go
  2. 15 1
      ent/entity/user.go

+ 6 - 8
common/src/qfw/util/dataexport/common.go

@@ -64,17 +64,15 @@ func GetDataExportMatchKey(scd *SieveCondition, list *[]map[string]interface{})
 		//统计关键词
 		for _, vk := range scd.Keyword {
 			key := []string{}
-			if strings.Contains(vk.Keyword, " ") {
-				for _, v := range strings.Split(vk.Keyword, " ") {
-					if v != "" {
-						key = append(key, v)
-					}
+			for _, v := range strings.Split(vk.Keyword, " ") {
+				if v != "" {
+					key = append(key, v)
 				}
-			} else {
-				key = append(key, vk.Keyword)
 			}
 			if len(vk.Appended) > 0 {
-				key = append(key, vk.Appended...)
+				for _, v := range vk.Appended {
+					key = append(key, strings.Split(v, " ")...)
+				}
 			}
 			vk.Keyword = strings.Join(key, ",")
 			keys = append(keys, strings.ReplaceAll(vk.Keyword, "+", ","))

+ 15 - 1
ent/entity/user.go

@@ -188,6 +188,11 @@ func (u *User) Add(tx *sql.Tx, entId int, user *User, paymentAddress, source, ns
 func (u *User) Update(mail string, userId, deptId, entId int) bool {
 	return Mysql.ExecTx("修改员工", func(tx *sql.Tx) bool {
 		ok_1 := Mysql.UpdateOrDeleteBySqlByTx(tx, `update entniche_user set mail=?,timestamp=? where id=? and ent_id=?`, mail, NowFormat(Date_Full_Layout), userId, entId)
+		Mgo_Bidding.Update("ent_user", map[string]interface{}{"i_entid": entId, "i_userid": userId}, map[string]interface{}{
+			"$set": map[string]interface{}{
+				"o_pushset.s_email": mail,
+			},
+		}, true, false)
 		ok_2 := VarUser.Move(tx, entId, deptId, fmt.Sprint(userId))
 		return ok_1 == 1 && ok_2
 	})
@@ -274,8 +279,12 @@ func (u *User) PhoneExist(phone string, entId int) *[]map[string]interface{} {
 func (u *User) UpdateInfo(mail string, phone string, name string, userId, deptId, entId int, entPhone string, entName string, isAdmin bool) bool {
 	if isAdmin {
 		ok := Mysql.ExecTx("修改员工", func(tx *sql.Tx) bool {
-
 			ok_1 := Mysql.UpdateOrDeleteBySqlByTx(tx, `update entniche_user set mail=?,phone=?,name=?,timestamp=? where id=? and ent_id=?`, mail, phone, name, NowFormat(Date_Full_Layout), userId, entId)
+			Mgo_Bidding.Update("ent_user", map[string]interface{}{"i_entid": entId, "i_userid": userId}, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"o_pushset.s_email": mail,
+				},
+			}, true, false)
 			ok_2 := Mysql.UpdateOrDeleteBySqlByTx(tx, "update entniche_info set admin=?,phone=? where id=?", name, phone, entId)
 			ok_3 := VarUser.Move(tx, entId, deptId, fmt.Sprint(userId))
 			return ok_1 != -1 && ok_3 && ok_2 != -1
@@ -293,6 +302,11 @@ func (u *User) UpdateInfo(mail string, phone string, name string, userId, deptId
 	} else {
 		return Mysql.ExecTx("修改员工", func(tx *sql.Tx) bool {
 			ok_1 := Mysql.UpdateOrDeleteBySqlByTx(tx, `update entniche_user set mail=?,phone=?,name=?,timestamp=? where id=? and ent_id=?`, mail, phone, name, NowFormat(Date_Full_Layout), userId, entId)
+			Mgo_Bidding.Update("ent_user", map[string]interface{}{"i_entid": entId, "i_userid": userId}, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"o_pushset.s_email": mail,
+				},
+			}, true, false)
 			ok_2 := VarUser.Move(tx, entId, deptId, fmt.Sprint(userId))
 			return ok_1 == 1 && ok_2
 		})