作者 tangxvhui

机会权限调整

... ... @@ -72,6 +72,8 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
sql5 string = fmt.Sprintf(` SELECT id FROM chance where publish_status = %d AND enable_status=1 AND review_status = 3 AND company_id=%d `, models.ChancePublishStatus2, companyid)
//查看所有公开的
sql6 string = fmt.Sprintf(`SELECT id FROM chance WHERE review_status =3 AND enable_status=1 And company_id=%d `, companyid)
//获取指定部门未通过的
sql7 string = "SELECT id FROM chance WHERE department_id IN (%s) and review_status =2 AND enable_status=1"
allsql string = ` SELECT t.id FROM (%s) as t `
unionsql string = ``
... ... @@ -132,6 +134,17 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
sqlslice = append(sqlslice, fmt.Sprintf(sql3, strings.Join(ids, ",")))
}
}
if _, ok := usrPermission.CheckMap[serverabc.OpportunityCheckLv4]; ok {
//指定部门
ids := []string{}
for _, v := range usrPermission.CheckOption.Departments {
ids = append(ids, fmt.Sprint(v.Id))
}
if len(ids) > 0 {
log.Debug("命中规则:指定部门")
sqlslice = append(sqlslice, fmt.Sprintf(sql7, strings.Join(ids, ",")))
}
}
if len(usrPermission.CheckMap) > 0 {
sqlslice = append(sqlslice, sql5)
}
... ...