瀏覽代碼

Merge branch 'feature/531-bowen-wecom' into debug

lichangdong 3 天之前
父節點
當前提交
a29477205c

+ 4 - 4
internal/logic/contact/get_contact_list_logic.go

@@ -128,16 +128,16 @@ func (l *GetContactListLogic) GetContactList(req *types.ContactListReq) (*types.
 		predicates = append(predicates, contact.Ctype(1)) // 默认 Ctype = 1
 	}
 
-	if req.WxWxid != nil {
+	if req.WxWxid != nil && *req.WxWxid != "" {
 		predicates = append(predicates, contact.WxWxidContains(*req.WxWxid))
 	}
-	if req.Wxid != nil {
+	if req.Wxid != nil && *req.Wxid != "" {
 		predicates = append(predicates, contact.WxidContains(*req.Wxid))
 	}
-	if req.Account != nil {
+	if req.Account != nil && *req.Account != "" {
 		predicates = append(predicates, contact.AccountContains(*req.Account))
 	}
-	if req.Nickname != nil {
+	if req.Nickname != nil && *req.Nickname != "" {
 		predicates = append(predicates, contact.NicknameContains(*req.Nickname))
 	}
 	if req.Type != nil {

+ 3 - 3
internal/logic/label_relationship/get_label_relationship_list_logic.go

@@ -80,10 +80,10 @@ func (l *GetLabelRelationshipListLogic) GetLabelRelationshipList(req *types.Labe
 		conPreds = append(conPreds, contact.Ctype(1)) // 默认 Ctype = 1
 	}
 
-	if req.WxWxid != nil {
+	if req.WxWxid != nil && *req.WxWxid != "" {
 		conPreds = append(conPreds, contact.WxWxidContains(*req.WxWxid))
 	}
-	if req.Wxid != nil {
+	if req.Wxid != nil && *req.Wxid != "" {
 		conPreds = append(conPreds, contact.WxidContains(*req.Wxid))
 	}
 
@@ -93,7 +93,7 @@ func (l *GetLabelRelationshipListLogic) GetLabelRelationshipList(req *types.Labe
 		conPreds = append(conPreds, contact.Or(contact.TypeEQ(1), contact.TypeEQ(2), contact.TypeEQ(4)))
 	}
 
-	if req.Nickname != nil {
+	if req.Nickname != nil && *req.Nickname != "" {
 		conPreds = append(conPreds, contact.NicknameContains(*req.Nickname))
 	}