|
@@ -7,6 +7,7 @@ import (
|
|
|
"dashoo.cn/opms_libary/myerrors"
|
|
"dashoo.cn/opms_libary/myerrors"
|
|
|
"database/sql"
|
|
"database/sql"
|
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/frame/g"
|
|
|
|
|
+ "github.com/gogf/gf/os/gtime"
|
|
|
"github.com/gogf/gf/util/gconv"
|
|
"github.com/gogf/gf/util/gconv"
|
|
|
"strconv"
|
|
"strconv"
|
|
|
"strings"
|
|
"strings"
|
|
@@ -179,11 +180,11 @@ func (s *followupService) GetListByDay(req *model.SearchPlatFollowupReq) (total
|
|
|
followupModel = followupModel.Where("created_by", s.GetCxtUserId())
|
|
followupModel = followupModel.Where("created_by", s.GetCxtUserId())
|
|
|
}
|
|
}
|
|
|
// 日期条件
|
|
// 日期条件
|
|
|
- //if req.DaysBeforeToday > 0 { // 获取前N天的跟进记录
|
|
|
|
|
- // now := gtime.Now()
|
|
|
|
|
- // begin := now.AddDate(0, 0, -req.DaysBeforeToday).Format("Y-m-d 00:00:00")
|
|
|
|
|
- // followupModel = followupModel.Where("follow_date>=?", begin)
|
|
|
|
|
- //}
|
|
|
|
|
|
|
+ if req.DaysBeforeToday > 0 { // 获取前N天的跟进记录
|
|
|
|
|
+ now := gtime.Now()
|
|
|
|
|
+ begin := now.AddDate(0, 0, -req.DaysBeforeToday).Format("Y-m-d 00:00:00")
|
|
|
|
|
+ followupModel = followupModel.Where("follow_date>=?", begin)
|
|
|
|
|
+ }
|
|
|
// 获取日期区间范围内的记录
|
|
// 获取日期区间范围内的记录
|
|
|
if req.BeginTime != "" && req.EndTime != "" {
|
|
if req.BeginTime != "" && req.EndTime != "" {
|
|
|
begin := strings.Split(req.BeginTime, " ")[0] + " 00:00:00"
|
|
begin := strings.Split(req.BeginTime, " ")[0] + " 00:00:00"
|
|
@@ -193,14 +194,6 @@ func (s *followupService) GetListByDay(req *model.SearchPlatFollowupReq) (total
|
|
|
if req.FollowType != "" {
|
|
if req.FollowType != "" {
|
|
|
followupModel = followupModel.Where("follow_type", req.FollowType)
|
|
followupModel = followupModel.Where("follow_type", req.FollowType)
|
|
|
}
|
|
}
|
|
|
- if req.CreateOn != "" {
|
|
|
|
|
- dates := strings.Split(req.CreateOn, ",")
|
|
|
|
|
- if len(dates) == 2 {
|
|
|
|
|
- begin := dates[0]
|
|
|
|
|
- end := dates[1]
|
|
|
|
|
- followupModel = followupModel.Where("follow_date>=? AND follow_date<=?", begin, end)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
//跟进记录销售 添加销售人权限
|
|
//跟进记录销售 添加销售人权限
|
|
|
if req.Sell != "" {
|
|
if req.Sell != "" {
|
|
|
followupModel = followupModel.Where("created_by", s.CxtUser.Id)
|
|
followupModel = followupModel.Where("created_by", s.CxtUser.Id)
|