...
|
...
|
@@ -111,12 +111,12 @@ func DeleteChance(id int64) (err error) { |
|
|
func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
|
|
sql := `select a.*,b.images,speechs,videos
|
|
|
from (
|
|
|
select id,user_id,create_at,update_at,approve_time chance_approve_time,source_content,approve_data,review_status,enable_status,status from chance
|
|
|
where user_id=? and company_id=? and review_status in (?) and (?=0 or id<?) and status=1 and enable_status=1
|
|
|
select id,user_id,create_at,update_at,update_at chance_approve_time,source_content,approve_data,review_status,enable_status,status from chance
|
|
|
where user_id=? and company_id=? and review_status in (?) and (?=0 or unix_timestamp(update_at)<?) and status=1 and enable_status=1
|
|
|
) a left JOIN chance_data b on a.id =b.chance_id
|
|
|
order by update_at desc
|
|
|
limit ?
|
|
|
`
|
|
|
` //approve_time
|
|
|
//update_at
|
|
|
sqlCount := fmt.Sprintf(`select count(0) from (
|
|
|
select id,user_id,create_at,source_content from chance
|
...
|
...
|
@@ -137,10 +137,11 @@ func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, |
|
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
|
|
select a.*,b.user_id,b.source_content,b.enable_status,b.review_status,b.create_at,b.update_at,b.approve_time chance_approve_time,b.status from (
|
|
|
select id,approve_time,approve_data,uid,chance_id,approve_message,update_at process_create_time
|
|
|
from audit_flow_process where uid=? and review_status in (%v) and (?=0 or id<?)
|
|
|
from audit_flow_process where uid=? and review_status in (%v)
|
|
|
)a left outer join chance b on a.chance_id = b.id
|
|
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
|
|
order by process_create_time desc
|
|
|
where (?=0 or unix_timestamp(a.update_at)<?)
|
|
|
order by a.update_at desc
|
|
|
LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //and enable_status =1 //就算已经删除了,列表上面还是要体现已经删除
|
|
|
|
|
|
sqlCount := fmt.Sprintf(`select count(0)
|
...
|
...
|
@@ -160,10 +161,11 @@ func GetChanceMyApproveChanceEnable(uid, cid int64, reviewStatus []int8, lastId |
|
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
|
|
select a.*,b.user_id,b.source_content,b.enable_status,b.review_status,b.create_at,b.update_at,b.approve_time chance_approve_time,b.status,b.update_at process_create_time from (
|
|
|
select id,approve_time,approve_data,uid,chance_id,approve_message
|
|
|
from audit_flow_process where uid=? and review_status in (%v) and (?=0 or id<?) and enable_status =1
|
|
|
from audit_flow_process where uid=? and review_status in (%v) and enable_status =1
|
|
|
)a left outer join chance b on a.chance_id = b.id
|
|
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
|
|
order by process_create_time desc
|
|
|
where (?=0 or unix_timestamp(a.update_at)<?)
|
|
|
order by a.update_at desc
|
|
|
LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //,update_at process_create_time
|
|
|
|
|
|
sqlCount := fmt.Sprintf(`select count(0)
|
...
|
...
|
@@ -477,12 +479,12 @@ limit %v |
|
|
sqlCount := fmt.Sprintf(`
|
|
|
select count(0) 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 chance
|
|
|
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
|
|
|
|
|
|
UNION
|
|
|
##指定部门-机会公开的部门
|
|
|
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 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
|
|
|
UNION
|
...
|
...
|
@@ -493,7 +495,7 @@ select count(0) from ( |
|
|
UNION
|
|
|
|
|
|
##我审核
|
|
|
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 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
|
|
|
) a inner join chance b on a.chance_id = b.id
|
|
|
|
...
|
...
|
|