WH01243 2 лет назад
Родитель
Сommit
7dfbd03938
1 измененных файлов с 18 добавлено и 4 удалено
  1. 18 4
      entity/jyUser.go

+ 18 - 4
entity/jyUser.go

@@ -26,9 +26,23 @@ func (rpc *JyUser) AddUserInfo(info *CompletionUserInfo, res *Resp) error {
 	userPositionId := int64(0)
 	entPositionId := int64(0)
 	fool := BaseMysql.ExecTx("", func(tx *sql.Tx) bool {
-		userData := BaseMysql.FindOne(UserTable, map[string]interface{}{
-			"phone": info.Phone,
-		}, "person_id,id,nickname", "")
+		users, ok := Mgo.Find("user", map[string]interface{}{
+			"i_appid": 2,
+			"$or": []map[string]interface{}{
+				map[string]interface{}{
+					"s_phone": info.Phone,
+				},
+				map[string]interface{}{
+					"s_m_phone": info.Phone,
+				},
+			},
+		}, `{"base_user_id":-1}`, `{"base_user_id":1}`, false, -1, -1)
+		userData := &map[string]interface{}{}
+		if ok && users != nil && len(*users) > 0 {
+			userData = BaseMysql.FindOne(UserTable, map[string]interface{}{
+				"id": (*users)[0]["base_user_id"],
+			}, "person_id,id,nickname", "")
+		}
 		if info.IsEnt {
 			//需要创建企业用户
 			entMap := map[string]interface{}{
@@ -124,7 +138,7 @@ func (rpc *JyUser) AddUserInfo(info *CompletionUserInfo, res *Resp) error {
 			//个人职位
 			//职位表添加
 			userPositionMap := map[string]interface{}{
-				"ent_id":       info.EntId,
+				"ent_id":       0,
 				"user_id":      userId,
 				"account_id":   userAccountId,
 				"person_name":  personName,