瀏覽代碼

feat:core 查询参标信息时字段调整

fuwencai 2 年之前
父節點
當前提交
8537e85398
共有 2 個文件被更改,包括 11 次插入11 次删除
  1. 9 9
      jyBXCore/rpc/model/tidb/tidb.go
  2. 2 2
      jyBXCore/rpc/service/participateBid.go

+ 9 - 9
jyBXCore/rpc/model/tidb/tidb.go

@@ -382,31 +382,31 @@ func GetUserMap(userIds string) (rs *[]map[string]interface{}) {
 
 // CheckParticipateManager 验证项目id是否是该管理员企业下的参标项目
 func CheckParticipateManager(projectId string, entId int64, valid bool) (flag bool) {
-	statusStr := "" // 是否需要验证是正在参标
+	stateStr := "" // 是否需要验证是正在参标
 	if valid {
-		statusStr = " and status=0"
+		stateStr = " and state=0"
 	}
-	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and ent_id=?" + statusStr
+	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and ent_id=?" + stateStr
 	return IC.BaseMysql.CountBySql(query, projectId, entId) > 0
 }
 
 // CheckParticipateEntUser 验证项目id是否是该企业用户参标的项目
 func CheckParticipateEntUser(projectId string, entUserId int64, valid bool) (flag bool) {
-	statusStr := "" // 是否需要验证是正在参标
+	stateStr := "" // 是否需要验证是正在参标
 	if valid {
-		statusStr = " and status=0"
+		stateStr = " and state=0"
 	}
-	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and ent_user_id=?" + statusStr
+	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and ent_user_id=?" + stateStr
 	return IC.BaseMysql.CountBySql(query, projectId, entUserId) > 0
 
 }
 
 // CheckParticipatePersonal 查询项目id是否是该用户参标项目
 func CheckParticipatePersonal(projectId string, positionId int64, valid bool) (flag bool) {
-	statusStr := "" // 是否需要验证是正在参标 终止参标的用户还能查看记录,但是不能更新状态
+	stateStr := "" // 是否需要验证是正在参标 终止参标的用户还能查看记录,但是不能更新状态
 	if valid {
-		statusStr = " and status=0"
+		stateStr = " and state=0"
 	}
-	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and position_id=?" + statusStr
+	query := "SELECT count(id) FROM " + ParticipateUserTable + " where project_id=? and position_id=?" + stateStr
 	return IC.BaseMysql.CountBySql(query, projectId, positionId) > 0
 }

+ 2 - 2
jyBXCore/rpc/service/participateBid.go

@@ -63,7 +63,7 @@ func (p *ParticipateBid) PersonalExistProject(projectId []string) map[string]str
 		value = append(value, projectId[i])
 	}
 	argStr := strings.Join(arg, ",")
-	query := "select project_id from " + TableParticipateUser + " where position_id = ? and project_id in (%s)  and status=0"
+	query := "select project_id from " + TableParticipateUser + " where position_id = ? and project_id in (%s)  and state=0"
 	rs := IC.BaseMysql.SelectBySql(fmt.Sprintf(query, argStr), value...)
 	existProjectSet := map[string]struct{}{}
 	if rs != nil && len(*rs) > 0 { // 如果查到了  说明已经参标 这部分应该显示已参标
@@ -103,7 +103,7 @@ func (p *ParticipateBid) EntExistProject(projectId []string) map[string]string {
 		value = append(value, projectId[i])
 	}
 	argStr := strings.Join(arg, ",")
-	query := "select GROUP_CONCAT(ent_user_id) as personIds ,project_id from " + TableParticipateUser + " where ent_id=? and  project_id in (%s) and status=0  group by project_id "
+	query := "select GROUP_CONCAT(ent_user_id) as personIds ,project_id from " + TableParticipateUser + " where ent_id=? and  project_id in (%s) and state=0  group by project_id "
 	rs := IC.BaseMysql.SelectBySql(fmt.Sprintf(query, argStr), value...)
 	existProjectMap := map[string]string{}
 	if rs != nil && len(*rs) > 0 { // 如果查到了  说明这个项目公司里面已经参标 处理一下信息用于后边判断是否是自己参标