作者 yangfu

审批修改

... ... @@ -266,6 +266,10 @@ func GetChancePoolSpecialDepartment(uid, cid int64, chanceTypeId int, lastId int
sql := fmt.Sprintf(`
select a.*,b.images,speechs,videos from (
select * from (
##公司公开的机会
select id,user_id,create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id from chance
where company_id = %v and publish_status = 2
##指定部门-机会提交的部门
select id,user_id,create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id from chance
where department_id in (%v)
... ... @@ -285,10 +289,14 @@ select * from (
order by create_at desc
limit %v
) a left JOIN chance_data b on a.id =b.chance_id
`, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId, lastId, lastId, pageSize)
`, cid, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId, lastId, lastId, pageSize)
sqlCount := fmt.Sprintf(`
select count(0) from (
##公司公开的机会
select id,user_id,create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id from chance
where company_id = %v and publish_status = 2
##指定部门-机会提交的部门
select id,user_id,create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id from chance
where department_id in (%v)
... ... @@ -305,7 +313,7 @@ select count(0) from (
) a inner join chance b on a.chance_id = b.id
) a where review_status=3 and (0=%v or chance_type_id =%v) and a.enable_status=1
`, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId)
`, cid, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId)
if err = utils.ExecuteQueryOne(&total, sqlCount); err != nil {
return
}
... ...
... ... @@ -140,7 +140,7 @@ func SympathyAction(header *protocol.RequestHeader, request *protocol.SympathyAc
Id: idgen.Next(),
UserId: header.UserId,
CompanyId: header.CompanyId,
MarkFlag: request.SympathyType,
MarkFlag: request.MarkType,
SourceType: request.SourceType,
SourceId: request.Id,
ChanceType: chanceType,
... ...