|
|
@@ -182,7 +182,7 @@ func (s *followupService) GetListByDay(req *model.SearchPlatFollowupReq) (total
|
|
|
filter["orcols"] = orCols
|
|
|
}
|
|
|
}
|
|
|
- followupModel := s.Dao.DataScope(s.Ctx, filter)
|
|
|
+ followupModel := s.Dao.As("plat_followup").DataScope(s.Ctx, filter)
|
|
|
// 用户仅有销售工程师角色展示自己的数据,其他人可以看到所有数据
|
|
|
//if garray.NewStrArrayFrom(s.CxtUser.Roles, true).Contains("SalesEngineer") {
|
|
|
// followupModel = followupModel.WhereIn("created_by", s.DataScope["userIds"])
|
|
|
@@ -206,14 +206,14 @@ func (s *followupService) GetListByDay(req *model.SearchPlatFollowupReq) (total
|
|
|
followupModel = followupModel.WhereLike("target_name", "%"+req.TargetName+"%")
|
|
|
}
|
|
|
if req.CreatedName != "" {
|
|
|
- followupModel = followupModel.WhereLike("created_name", "%"+req.CreatedName+"%")
|
|
|
+ followupModel = followupModel.WhereLike("plat_followup.created_name", "%"+req.CreatedName+"%")
|
|
|
}
|
|
|
// 负责人查询
|
|
|
if req.ManagerId != "" {
|
|
|
- followupModel = followupModel.Where("created_by", req.ManagerId)
|
|
|
+ followupModel = followupModel.Where("plat_followup.created_by", req.ManagerId)
|
|
|
}
|
|
|
if req.IsMyself == "1" {
|
|
|
- followupModel = followupModel.Where("created_by", s.GetCxtUserId())
|
|
|
+ followupModel = followupModel.Where("plat_followup.created_by", s.GetCxtUserId())
|
|
|
}
|
|
|
// 日期条件
|
|
|
if req.DaysBeforeToday > 0 { // 获取前N天的跟进记录
|
|
|
@@ -233,7 +233,7 @@ func (s *followupService) GetListByDay(req *model.SearchPlatFollowupReq) (total
|
|
|
//跟进记录销售 添加销售人权限
|
|
|
arr := garray.NewStrArrayFrom(s.CxtUser.Roles, true)
|
|
|
if arr.Len() == 1 && arr.Contains("SalesEngineer") && req.Sell != "" {
|
|
|
- followupModel = followupModel.Where("created_by", s.CxtUser.Id)
|
|
|
+ followupModel = followupModel.Where("plat_followup.created_by", s.CxtUser.Id)
|
|
|
}
|
|
|
//total, err = followupModel.Count()
|
|
|
//if err != nil {
|