浏览代码

Merge branch 'dev/v1.1.20_fuwencai' of BaseService/jyMicroservices into feature/v1.1.20

fuwencai 2 年之前
父节点
当前提交
f144860162
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      jyBXCore/rpc/model/mysql/participateBid.go

+ 5 - 4
jyBXCore/rpc/model/mysql/participateBid.go

@@ -311,7 +311,7 @@ func UpdateParticipateSetInfo(in *bxcore.ParticipateSetUpInfoReq) error {
 	if in.IsAllow != "" {
 		if in.IsAllow == "0" { //修改为允许单人参标
 			//判断是否有多人参标的项目
-			pSql := `SELECT project_id,COUNT(id) AS c FROM ` + ParticipateUserTable + ` WHERE ent_id = ? GROUP BY project_id ORDER BY c DESC;`
+			pSql := `SELECT project_id,COUNT(id) AS c FROM ` + ParticipateUserTable + ` WHERE ent_id = ?  AND state =0 GROUP BY project_id ORDER BY c DESC;`
 			data := IC.BaseMysql.SelectBySql(pSql, in.EntId)
 			if data != nil && len(*data) > 0 {
 				if max := MC.IntAll((*data)[0]["c"]); max > 1 {
@@ -481,6 +481,7 @@ func ParticipateListSql(in *bxcore.ParticipateListReq) string {
 	if in.Keywords != "" {
 		kSql := ` AND (`
 		for kk, kv := range strings.Split(in.Keywords, " ") {
+			log.Println(kk, "----", kv)
 			if kk > 0 {
 				kSql += " OR "
 			}
@@ -634,13 +635,13 @@ func SingleParticipateList(in *bxcore.ParticipateListReq, conditionSql string) (
 	}
 	//员工|个人列表
 	singlePersonSql := `SELECT %s FROM ` + ParticipateUserTable + ` pug LEFT JOIN project pt ON pug.project_id = pt.id LEFT JOIN (SELECT project_id,position_id,MAX(create_date) AS create_date FROM participate_bid_records GROUP BY project_id,position_id) pbr ON pbr.project_id = pug.project_id AND pbr.position_id = pug.position_id WHERE pug.position_id = ? `
-	singlePersonSql += conditionSql
-	countSql := fmt.Sprintf(singlePersonSql, " COUNT(pt.id) ")
+	//singlePersonSql += conditionSql
+	countSql := fmt.Sprintf(singlePersonSql, " COUNT(pt.id) ") + conditionSql
 	count := IC.BaseMysql.CountBySql(countSql, in.PositionId)
 	log.Println(countSql, "---", count)
 	if count > 0 {
 		data.Count = count
-		listSql := fmt.Sprintf(singlePersonSql, " pt.*,pbr.create_date ")
+		listSql := fmt.Sprintf(singlePersonSql, " pt.*,pbr.create_date ") + conditionSql
 		//分页
 		listSql += fmt.Sprintf(` LIMIT %d,%d`, in.PageNum, in.PageSize)
 		log.Println("listSql:", listSql)