|
@@ -614,7 +614,7 @@ func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string, so
|
|
if len(source) > 0 {
|
|
if len(source) > 0 {
|
|
sourceArr := []string{}
|
|
sourceArr := []string{}
|
|
for i := 0; i < len(source); i++ {
|
|
for i := 0; i < len(source); i++ {
|
|
- sourceArr = append(sourceArr, fmt.Sprintf(" FIND_IN_SET('%d', a.source)", source[i]))
|
|
|
|
|
|
+ sourceArr = append(sourceArr, fmt.Sprintf(" FIND_IN_SET('%d', source)", source[i]))
|
|
}
|
|
}
|
|
query = append(query, fmt.Sprintf(" (%s) ", strings.Join(sourceArr, " or ")))
|
|
query = append(query, fmt.Sprintf(" (%s) ", strings.Join(sourceArr, " or ")))
|
|
}
|
|
}
|
|
@@ -647,13 +647,11 @@ func (in *ParticipateStatistics) ProjectDetails(entUserIdArr []string, detailReq
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-// todo 查询条件验证
|
|
|
|
-//
|
|
|
|
// 这个查询只用查出符合筛选条件的项目id 以及该项目对应的stage
|
|
// 这个查询只用查出符合筛选条件的项目id 以及该项目对应的stage
|
|
// 查询类型 0空搜索 全连接 1查左边 连右表查stage 2只查右表 3内连接
|
|
// 查询类型 0空搜索 全连接 1查左边 连右表查stage 2只查右表 3内连接
|
|
func GetDetailQuery(isEnt bool, personArrStr string, req *bxcore.ProjectDetailsReq, queryType int) (string, string) {
|
|
func GetDetailQuery(isEnt bool, personArrStr string, req *bxcore.ProjectDetailsReq, queryType int) (string, string) {
|
|
// 处理分页
|
|
// 处理分页
|
|
- if req.PageNum == 0 && req.PageSize == 0 {
|
|
|
|
|
|
+ if req.PageNum == 0 || req.PageSize == 0 {
|
|
req.PageNum = 1
|
|
req.PageNum = 1
|
|
req.PageSize = 50
|
|
req.PageSize = 50
|
|
}
|
|
}
|
|
@@ -663,7 +661,7 @@ func GetDetailQuery(isEnt bool, personArrStr string, req *bxcore.ProjectDetailsR
|
|
// 空搜索调整
|
|
// 空搜索调整
|
|
query1, query2 := []string{}, []string{}
|
|
query1, query2 := []string{}, []string{}
|
|
query3 := ""
|
|
query3 := ""
|
|
- //没有传时间,默认时间处理 todo
|
|
|
|
|
|
+ //没有传时间,默认时间处理
|
|
var start = time.Now().AddDate(0, 0, -10)
|
|
var start = time.Now().AddDate(0, 0, -10)
|
|
query1 = append(query1, fmt.Sprintf(" a.ymd >= %s ", start.Local().Format("20060102")))
|
|
query1 = append(query1, fmt.Sprintf(" a.ymd >= %s ", start.Local().Format("20060102")))
|
|
query2 = append(query2, fmt.Sprintf(" b.update_date >= '%s' ", start.Local().Format(date.Date_Full_Layout)))
|
|
query2 = append(query2, fmt.Sprintf(" b.update_date >= '%s' ", start.Local().Format(date.Date_Full_Layout)))
|
|
@@ -972,7 +970,7 @@ func getNewPushInfo(projectIds []string, entId int, positionId int, positionType
|
|
}
|
|
}
|
|
sql := `
|
|
sql := `
|
|
SELECT
|
|
SELECT
|
|
- A.project_id, A.source,DATE_FORMAT(A.visit_date,'%%Y-%%m-%%d') as visit_date, DATE_FORMAT(A.dis_date,'%%Y-%%m-%%d') as dis_date, A.is_distribute,A.id,A.ymd,B.ymd
|
|
|
|
|
|
+ A.project_id, A.source,DATE_FORMAT(A.visit_date,'%%Y-%%m-%%d') as visit_date, DATE_FORMAT(A.dis_date,'%%Y-%%m-%%d') as dis_date,A.id,A.ymd,B.ymd
|
|
FROM participate_push_statistics A inner join (SELECT
|
|
FROM participate_push_statistics A inner join (SELECT
|
|
project_id,MAX(ymd) as ymd
|
|
project_id,MAX(ymd) as ymd
|
|
FROM
|
|
FROM
|
|
@@ -995,7 +993,9 @@ func GetQueryType(in *bxcore.ProjectDetailsReq) int {
|
|
}
|
|
}
|
|
if in.IsParticipate == 1 {
|
|
if in.IsParticipate == 1 {
|
|
// 未参标只筛选推送表 右表条件无效
|
|
// 未参标只筛选推送表 右表条件无效
|
|
-
|
|
|
|
|
|
+ in.BidWay = 0
|
|
|
|
+ in.BidUpdateStartTime = 0
|
|
|
|
+ in.BidUpdateEndTime = 0
|
|
return 1
|
|
return 1
|
|
}
|
|
}
|
|
if (in.StartTime != 0 || in.EndTime != 0 || len(in.Source) > 0) && (in.BidUpdateStartTime == 0 && in.BidUpdateEndTime == 0 && in.IsParticipate != 2) {
|
|
if (in.StartTime != 0 || in.EndTime != 0 || len(in.Source) > 0) && (in.BidUpdateStartTime == 0 && in.BidUpdateEndTime == 0 && in.IsParticipate != 2) {
|