Browse Source

修复bug

lichangdong 3 weeks ago
parent
commit
6a87a36132
1 changed files with 4 additions and 7 deletions
  1. 4 7
      internal/logic/contact/get_contact_list_logic.go

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

@@ -62,8 +62,8 @@ func (l *GetContactListLogic) GetContactList(req *types.ContactListReq) (*types.
 	var startTime, endTime *time.Time
 	var startTime, endTime *time.Time
 
 
 	if req.StartDate != nil && *req.StartDate != "" {
 	if req.StartDate != nil && *req.StartDate != "" {
-		startStr := *req.StartDate + " 00:00:00"
-		if t, err := time.Parse(layout, startStr); err == nil {
+		//startStr := *req.StartDate + " 00:00:00"
+		if t, err := time.Parse(layout, *req.StartDate); err == nil {
 			t = t.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
 			t = t.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
 			startTime = &t
 			startTime = &t
 		} else {
 		} else {
@@ -72,8 +72,8 @@ func (l *GetContactListLogic) GetContactList(req *types.ContactListReq) (*types.
 	}
 	}
 
 
 	if req.EndDate != nil && *req.EndDate != "" {
 	if req.EndDate != nil && *req.EndDate != "" {
-		endStr := *req.EndDate + " 23:59:59"
-		if t, err := time.Parse(layout, endStr); err == nil {
+		//endStr := *req.EndDate + " 23:59:59"
+		if t, err := time.Parse(layout, *req.EndDate); err == nil {
 			t = t.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
 			t = t.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
 			endTime = &t
 			endTime = &t
 		} else {
 		} else {
@@ -89,9 +89,6 @@ func (l *GetContactListLogic) GetContactList(req *types.ContactListReq) (*types.
 	if endTime != nil {
 	if endTime != nil {
 		relPreds = append(relPreds, labelrelationship.CreatedAtLTE(*endTime))
 		relPreds = append(relPreds, labelrelationship.CreatedAtLTE(*endTime))
 	}
 	}
-	if len(relPreds) > 0 {
-		predicates = append(predicates, contact.HasContactRelationshipsWith(relPreds...))
-	}
 
 
 	if len(req.LabelIDs) > 0 {
 	if len(req.LabelIDs) > 0 {
 		relPreds = append(relPreds,
 		relPreds = append(relPreds,