|
@@ -614,7 +614,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
WHERE %s UNION
|
|
WHERE %s UNION
|
|
SELECT project_id
|
|
SELECT project_id
|
|
FROM participate_stage_statistics b
|
|
FROM participate_stage_statistics b
|
|
- WHERE %s)
|
|
|
|
|
|
+ WHERE %s) order by project_id
|
|
LIMIT %d , %d) A
|
|
LIMIT %d , %d) A
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
participate_stage_statistics B ON A.project_id = B.project_id and %s` // and 连接前对右表过滤
|
|
participate_stage_statistics B ON A.project_id = B.project_id and %s` // and 连接前对右表过滤
|
|
@@ -642,11 +642,11 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
joinStr = "and a.ent_id = b.ent_id"
|
|
joinStr = "and a.ent_id = b.ent_id"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if req.StartTime == 0 && req.EndTime == 0 {
|
|
|
|
- //没有传时间,默认时间处理
|
|
|
|
- var start = time.Now().AddDate(0, 0, -30)
|
|
|
|
- query = append(query, fmt.Sprintf(" a.ymd >= %s ", start.Local().Format("20060102")))
|
|
|
|
- }
|
|
|
|
|
|
+ //if req.StartTime == 0 && req.EndTime == 0 {
|
|
|
|
+ // //没有传时间,默认时间处理
|
|
|
|
+ // var start = time.Now().AddDate(0, 0, -30)
|
|
|
|
+ // query = append(query, fmt.Sprintf(" a.ymd >= %s ", start.Local().Format("20060102")))
|
|
|
|
+ //}
|
|
if req.StartTime != 0 {
|
|
if req.StartTime != 0 {
|
|
query = append(query, fmt.Sprintf(" a.ymd >= %d ", req.StartTime))
|
|
query = append(query, fmt.Sprintf(" a.ymd >= %d ", req.StartTime))
|
|
}
|
|
}
|
|
@@ -674,7 +674,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
if req.IsParticipate != -1 {
|
|
if req.IsParticipate != -1 {
|
|
query = append(query, fmt.Sprintf("a.isparticipate = %d", req.IsParticipate))
|
|
query = append(query, fmt.Sprintf("a.isparticipate = %d", req.IsParticipate))
|
|
}
|
|
}
|
|
- q = "select distinct(a.project_id),b.stage,a.id,b.id as bid from participate_push_statistics a left join participate_stage_statistics b on(a.project_id=b.project_id %s ) where %s order by a.id desc,b.id desc"
|
|
|
|
|
|
+ q = "select distinct(a.project_id),b.stage,a.ymd,b.update_date from participate_push_statistics a left join participate_stage_statistics b on(a.project_id=b.project_id %s ) where %s order by a.ymd desc,b.update_date desc"
|
|
qCount = "select count(distinct(a.project_id)) from participate_push_statistics a left join participate_stage_statistics b on(a.project_id=b.project_id %s) where %s"
|
|
qCount = "select count(distinct(a.project_id)) from participate_push_statistics a left join participate_stage_statistics b on(a.project_id=b.project_id %s) where %s"
|
|
} else if queryType == 2 {
|
|
} else if queryType == 2 {
|
|
if isAdmin {
|
|
if isAdmin {
|
|
@@ -686,17 +686,17 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
}
|
|
}
|
|
if len(personArr) > 0 {
|
|
if len(personArr) > 0 {
|
|
personStr := strings.Join(personArr, " or ")
|
|
personStr := strings.Join(personArr, " or ")
|
|
- query = append(query, personStr)
|
|
|
|
|
|
+ query = append(query, fmt.Sprintf("(%s)", personStr))
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//不是管理员
|
|
//不是管理员
|
|
query = append(query, fmt.Sprintf(" FIND_IN_SET('%s', b.position_ids)", personArrStr))
|
|
query = append(query, fmt.Sprintf(" FIND_IN_SET('%s', b.position_ids)", personArrStr))
|
|
}
|
|
}
|
|
- // 右连接无默认时间时
|
|
|
|
- if req.BidUpdateStartTime == 0 && req.BidUpdateEndTime == 0 {
|
|
|
|
- var start = time.Now().AddDate(0, 0, -30)
|
|
|
|
- query = append(query, fmt.Sprintf(" b.update_date >= '%s' ", start.Local().Format(date.Date_Full_Layout)))
|
|
|
|
- }
|
|
|
|
|
|
+ //// 无默认时间时
|
|
|
|
+ //if req.BidUpdateStartTime == 0 && req.BidUpdateEndTime == 0 {
|
|
|
|
+ // var start = time.Now().AddDate(0, 0, -30)
|
|
|
|
+ // query = append(query, fmt.Sprintf(" b.update_date >= '%s' ", start.Local().Format(date.Date_Full_Layout)))
|
|
|
|
+ //}
|
|
|
|
|
|
// 参标状态更新时间
|
|
// 参标状态更新时间
|
|
if req.BidUpdateStartTime != 0 {
|
|
if req.BidUpdateStartTime != 0 {
|
|
@@ -724,7 +724,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
if req.IsParticipate == 1 {
|
|
if req.IsParticipate == 1 {
|
|
query = append(query, fmt.Sprintf("b.isparticipate = %d", req.IsParticipate))
|
|
query = append(query, fmt.Sprintf("b.isparticipate = %d", req.IsParticipate))
|
|
}
|
|
}
|
|
- q = "select distinct(b.project_id),b.stage,a.id,b.id from participate_stage_statistics b where %s %s order by b.id desc"
|
|
|
|
|
|
+ q = "select b.project_id,b.stage from participate_stage_statistics b where %s %s order by b.update_date desc"
|
|
qCount = "select count(b.project_id) from participate_stage_statistics b where %s %s"
|
|
qCount = "select count(b.project_id) from participate_stage_statistics b where %s %s"
|
|
} else {
|
|
} else {
|
|
if isAdmin {
|
|
if isAdmin {
|
|
@@ -787,7 +787,7 @@ func GetDetailQuery(isAdmin bool, personArrStr string, req *bxcore.ProjectDetail
|
|
bidEnd := date.FormatDate(&bidEnd_, date.Date_Full_Layout)
|
|
bidEnd := date.FormatDate(&bidEnd_, date.Date_Full_Layout)
|
|
query = append(query, fmt.Sprintf("b.update_date < '%s'", bidEnd))
|
|
query = append(query, fmt.Sprintf("b.update_date < '%s'", bidEnd))
|
|
}
|
|
}
|
|
- q = "select distinct(a.project_id),b.stage,a.id,b.id from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id %s) where %s order by a.id desc,b.id desc"
|
|
|
|
|
|
+ q = "select distinct(a.project_id),b.stage,a.ymd,b.update_date from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id %s) where %s order by a.ymd desc,b.update_date desc"
|
|
qCount = "select count(distinct(a.project_id)) from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id %s) where %s"
|
|
qCount = "select count(distinct(a.project_id)) from participate_push_statistics a inner join participate_stage_statistics b on(b.project_id=a.project_id %s) where %s"
|
|
}
|
|
}
|
|
if len(query) > 0 {
|
|
if len(query) > 0 {
|