Prechádzať zdrojové kódy

feat:查询语句调整

fuwencai 1 rok pred
rodič
commit
143c5b235b

+ 7 - 7
jyBXCore/rpc/service/participateStatistics.go

@@ -614,7 +614,7 @@ func QueryHandle(isAdmin bool, startTime, endTime int64, personArrStr string, so
 	if len(source) > 0 {
 		sourceArr := []string{}
 		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 ")))
 	}
@@ -647,13 +647,11 @@ func (in *ParticipateStatistics) ProjectDetails(entUserIdArr []string, detailReq
 	return
 }
 
-//	todo 查询条件验证
-//
 // 这个查询只用查出符合筛选条件的项目id 以及该项目对应的stage
 // 查询类型  0空搜索 全连接 1查左边 连右表查stage 2只查右表 3内连接
 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.PageSize = 50
 	}
@@ -663,7 +661,7 @@ func GetDetailQuery(isEnt bool, personArrStr string, req *bxcore.ProjectDetailsR
 		// 空搜索调整
 		query1, query2 := []string{}, []string{}
 		query3 := ""
-		//没有传时间,默认时间处理 todo
+		//没有传时间,默认时间处理
 		var start = time.Now().AddDate(0, 0, -10)
 		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)))
@@ -972,7 +970,7 @@ func getNewPushInfo(projectIds []string, entId int, positionId int, positionType
 	}
 	sql := `
 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 
             project_id,MAX(ymd) as ymd
         FROM
@@ -995,7 +993,9 @@ func GetQueryType(in *bxcore.ProjectDetailsReq) int {
 	}
 	if in.IsParticipate == 1 {
 		// 未参标只筛选推送表 右表条件无效
-
+		in.BidWay = 0
+		in.BidUpdateStartTime = 0
+		in.BidUpdateEndTime = 0
 		return 1
 	}
 	if (in.StartTime != 0 || in.EndTime != 0 || len(in.Source) > 0) && (in.BidUpdateStartTime == 0 && in.BidUpdateEndTime == 0 && in.IsParticipate != 2) {