Kaynağa Gözat

feature(跟进):跟进添加过滤

ZZH-wl 2 yıl önce
ebeveyn
işleme
6e0e4b2216

+ 2 - 0
opms_parent/app/model/plat/plat_followup.go

@@ -18,7 +18,9 @@ type PlatFollowup internal.PlatFollowup
 // 查询
 type SearchPlatFollowupReq struct {
 	CustId          string `json:"custId"`
+	CustName        string `json:"custName"`
 	TargetType      string `son:"targetType"`
+	TargetName      string `json:"targetName"` // 跟进对象
 	TargetId        string `json:"targetId"`
 	ManagerId       string `json:"managerId"`
 	DaysBeforeToday int    `json:"daysBeforeToday"`

+ 12 - 0
opms_parent/app/service/plat/plat_followup.go

@@ -38,12 +38,18 @@ func (s *followupService) GetList(req *model.SearchPlatFollowupReq) (total int,
 	if req.CustId != "" {
 		followupModel = followupModel.Where("cust_id", req.CustId)
 	}
+	if req.CustName != "" {
+		followupModel = followupModel.WhereLike("cust_name", "%"+req.CustName+"%")
+	}
 	if req.TargetId != "" {
 		followupModel = followupModel.Where("target_id", req.TargetId)
 	}
 	if req.TargetType != "" {
 		followupModel = followupModel.Where("target_type", req.TargetType)
 	}
+	if req.TargetName != "" {
+		followupModel = followupModel.WhereLike("target_name", "%"+req.TargetName+"%")
+	}
 	// 负责人查询
 	if req.ManagerId != "" {
 		followupModel = followupModel.Where("created_by", req.ManagerId)
@@ -117,12 +123,18 @@ func (s *followupService) GetListByDay(req *model.SearchPlatFollowupReq) (total
 	if req.CustId != "" {
 		followupModel = followupModel.Where("cust_id", req.CustId)
 	}
+	if req.CustName != "" {
+		followupModel = followupModel.WhereLike("cust_name", "%"+req.CustName+"%")
+	}
 	if req.TargetId != "" {
 		followupModel = followupModel.Where("target_id", req.TargetId)
 	}
 	if req.TargetType != "" {
 		followupModel = followupModel.Where("target_type", req.TargetType)
 	}
+	if req.TargetName != "" {
+		followupModel = followupModel.WhereLike("target_name", "%"+req.TargetName+"%")
+	}
 	// 负责人查询
 	if req.ManagerId != "" {
 		followupModel = followupModel.Where("created_by", req.ManagerId)