作者 yangfu

机会池排序修改

... ... @@ -315,7 +315,7 @@ select * from (
##我审核
select id,user_id,approve_time create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id,status from (
select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3
select DISTINCT chance_id from audit_flow_process where uid =%v
) 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 (0=%v or unix_timestamp(create_at)<%v) and a.enable_status=1 and status=1
... ... @@ -328,17 +328,17 @@ limit %v
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,status from chance
where company_id = %v and publish_status = 2
where company_id = %v and publish_status = 2 and review_status=3
UNION
##指定部门-机会提交的部门
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,status from chance
where department_id in (%v)
where department_id in (%v) and review_status=3
UNION
##本人
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,status from chance
where user_id = %v
where user_id = %v and review_status=3
UNION
##我审核
... ... @@ -390,7 +390,7 @@ select * from (
##我审核
select id,user_id,approve_time create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id,status from (
select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3
select DISTINCT chance_id from audit_flow_process where uid =%v
) 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 (0=%v or unix_timestamp(create_at)<%v) and a.enable_status=1 and status=1
... ... @@ -426,7 +426,7 @@ 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,status from (
select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3
select DISTINCT chance_id from audit_flow_process where uid =%v
) 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 and status=1
... ... @@ -467,7 +467,7 @@ select * from (
##我审核
select id,user_id,approve_time create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id,status from (
select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3
select DISTINCT chance_id from audit_flow_process where uid =%v
) 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 (0=%v or unix_timestamp(create_at)<%v) and a.enable_status=1 and status=1
... ... @@ -480,18 +480,20 @@ limit %v
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,status from chance
where company_id = %v and publish_status = 2
where company_id = %v and publish_status = 2 and review_status=3
UNION
##指定部门-机会公开的部门
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,status from (
select DISTINCT chance_id from chance_department where department_id in (%v)
)a inner join chance b on a.chance_id = b.id
where review_status=3
UNION
##本人
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,status from chance
where user_id = %v
where user_id = %v and review_status=3
UNION
##我审核
... ... @@ -524,7 +526,7 @@ select * from (
##我审核
select id,user_id,approve_time create_at,source_content,review_status,audit_template_id,chance_type_id,comment_total,zan_total,view_total,enable_status,department_id,status from (
select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3
select DISTINCT chance_id from audit_flow_process where uid =%v
) 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 (0=%v or unix_timestamp(create_at)<%v) and a.enable_status=1 and status=1
... ... @@ -537,7 +539,7 @@ limit %v
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,status from chance
where user_id = %v
where user_id = %v and review_status=3
UNION
##我审核
... ...