Răsfoiți Sursa

Merge branch 'fixbug/568-bowen-form' into debug

* fixbug/568-bowen-form:
  fixbug

# Conflicts:
#	crontask/contact_form.go
boweniac 2 zile în urmă
părinte
comite
80e39b713a
1 a modificat fișierele cu 9 adăugiri și 9 ștergeri
  1. 9 9
      crontask/contact_form.go

+ 9 - 9
crontask/contact_form.go

@@ -310,7 +310,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 					value = 2
 				}
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetSex(value).
 					Save(l.ctx)
 				if err != nil {
@@ -318,7 +318,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 				}
 			} else if field.DataIndex == "phone" && c.Phone == "" {
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetPhone(field.Value[0]).
 					Save(l.ctx)
 				if err != nil {
@@ -326,7 +326,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 				}
 			} else if field.DataIndex == "name" && c.Cname == "" {
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetCname(field.Value[0]).
 					Save(l.ctx)
 				if err != nil {
@@ -338,7 +338,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 					continue
 				}
 				_, err = l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetCage(num).
 					Save(l.ctx)
 				if err != nil {
@@ -346,7 +346,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 				}
 			} else if field.DataIndex == "area" && c.Carea == "" {
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetCarea(field.Value[0]).
 					Save(l.ctx)
 				if err != nil {
@@ -354,7 +354,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 				}
 			} else if field.DataIndex == "birthday" && c.Cbirthday == "" {
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetCbirthday(field.Value[0]).
 					Save(l.ctx)
 				if err != nil {
@@ -362,7 +362,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 				}
 			} else if field.DataIndex == "birtharea" && c.Cbirtharea == "" {
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetCbirtharea(field.Value[0]).
 					Save(l.ctx)
 				if err != nil {
@@ -370,7 +370,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 				}
 			} else if field.DataIndex == "idcard_no" && c.CidcardNo == "" {
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetCidcardNo(field.Value[0]).
 					Save(l.ctx)
 				if err != nil {
@@ -378,7 +378,7 @@ func (l *CronTask) UpdateContactFields(botID string, receiverID string, fields [
 				}
 			} else if field.DataIndex == "title" && c.Ctitle == "" {
 				_, err := l.svcCtx.DB.Contact.Update().
-					Where(contact.WxidEQ(receiverID)).
+					Where(contact.WxWxidEQ(botID), contact.WxidEQ(receiverID)).
 					SetCtitle(field.Value[0]).
 					Save(l.ctx)
 				if err != nil {