|
@@ -111,12 +111,12 @@ func DeleteChance(id int64) (err error) { |
|
@@ -111,12 +111,12 @@ func DeleteChance(id int64) (err error) { |
111
|
func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
111
|
func GetChanceMyChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
112
|
sql := `select a.*,b.images,speechs,videos
|
112
|
sql := `select a.*,b.images,speechs,videos
|
113
|
from (
|
113
|
from (
|
114
|
-select id,user_id,create_at,update_at,approve_time chance_approve_time,source_content,approve_data,review_status,enable_status,status from chance
|
|
|
115
|
-where user_id=? and company_id=? and review_status in (?) and (?=0 or id<?) and status=1 and enable_status=1
|
114
|
+select id,user_id,create_at,update_at,update_at chance_approve_time,source_content,approve_data,review_status,enable_status,status from chance
|
|
|
115
|
+where user_id=? and company_id=? and review_status in (?) and (?=0 or unix_timestamp(update_at)<?) and status=1 and enable_status=1
|
116
|
) a left JOIN chance_data b on a.id =b.chance_id
|
116
|
) a left JOIN chance_data b on a.id =b.chance_id
|
117
|
order by update_at desc
|
117
|
order by update_at desc
|
118
|
limit ?
|
118
|
limit ?
|
119
|
-`
|
119
|
+` //approve_time
|
120
|
//update_at
|
120
|
//update_at
|
121
|
sqlCount := fmt.Sprintf(`select count(0) from (
|
121
|
sqlCount := fmt.Sprintf(`select count(0) from (
|
122
|
select id,user_id,create_at,source_content from chance
|
122
|
select id,user_id,create_at,source_content from chance
|
|
@@ -137,10 +137,11 @@ func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, |
|
@@ -137,10 +137,11 @@ func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, |
137
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
137
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
138
|
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 (
|
138
|
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 (
|
139
|
select id,approve_time,approve_data,uid,chance_id,approve_message,update_at process_create_time
|
139
|
select id,approve_time,approve_data,uid,chance_id,approve_message,update_at process_create_time
|
140
|
-from audit_flow_process where uid=? and review_status in (%v) and (?=0 or id<?)
|
140
|
+from audit_flow_process where uid=? and review_status in (%v)
|
141
|
)a left outer join chance b on a.chance_id = b.id
|
141
|
)a left outer join chance b on a.chance_id = b.id
|
142
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
142
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
143
|
-order by process_create_time desc
|
143
|
+where (?=0 or unix_timestamp(a.update_at)<?)
|
|
|
144
|
+order by a.update_at desc
|
144
|
LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //and enable_status =1 //就算已经删除了,列表上面还是要体现已经删除
|
145
|
LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //and enable_status =1 //就算已经删除了,列表上面还是要体现已经删除
|
145
|
|
146
|
|
146
|
sqlCount := fmt.Sprintf(`select count(0)
|
147
|
sqlCount := fmt.Sprintf(`select count(0)
|
|
@@ -160,10 +161,11 @@ func GetChanceMyApproveChanceEnable(uid, cid int64, reviewStatus []int8, lastId |
|
@@ -160,10 +161,11 @@ func GetChanceMyApproveChanceEnable(uid, cid int64, reviewStatus []int8, lastId |
160
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
161
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
161
|
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 (
|
162
|
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 (
|
162
|
select id,approve_time,approve_data,uid,chance_id,approve_message
|
163
|
select id,approve_time,approve_data,uid,chance_id,approve_message
|
163
|
-from audit_flow_process where uid=? and review_status in (%v) and (?=0 or id<?) and enable_status =1
|
164
|
+from audit_flow_process where uid=? and review_status in (%v) and enable_status =1
|
164
|
)a left outer join chance b on a.chance_id = b.id
|
165
|
)a left outer join chance b on a.chance_id = b.id
|
165
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
166
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
166
|
-order by process_create_time desc
|
167
|
+where (?=0 or unix_timestamp(a.update_at)<?)
|
|
|
168
|
+order by a.update_at desc
|
167
|
LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //,update_at process_create_time
|
169
|
LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //,update_at process_create_time
|
168
|
|
170
|
|
169
|
sqlCount := fmt.Sprintf(`select count(0)
|
171
|
sqlCount := fmt.Sprintf(`select count(0)
|
|
@@ -477,12 +479,12 @@ limit %v |
|
@@ -477,12 +479,12 @@ limit %v |
477
|
sqlCount := fmt.Sprintf(`
|
479
|
sqlCount := fmt.Sprintf(`
|
478
|
select count(0) from (
|
480
|
select count(0) from (
|
479
|
##公司公开的机会
|
481
|
##公司公开的机会
|
480
|
- 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
|
482
|
+ 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
|
481
|
where company_id = %v and publish_status = 2
|
483
|
where company_id = %v and publish_status = 2
|
482
|
|
484
|
|
483
|
UNION
|
485
|
UNION
|
484
|
##指定部门-机会公开的部门
|
486
|
##指定部门-机会公开的部门
|
485
|
- 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 (
|
487
|
+ 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 (
|
486
|
select DISTINCT chance_id from chance_department where department_id in (%v)
|
488
|
select DISTINCT chance_id from chance_department where department_id in (%v)
|
487
|
)a inner join chance b on a.chance_id = b.id
|
489
|
)a inner join chance b on a.chance_id = b.id
|
488
|
UNION
|
490
|
UNION
|
|
@@ -493,7 +495,7 @@ select count(0) from ( |
|
@@ -493,7 +495,7 @@ select count(0) from ( |
493
|
UNION
|
495
|
UNION
|
494
|
|
496
|
|
495
|
##我审核
|
497
|
##我审核
|
496
|
- 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 (
|
498
|
+ 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 (
|
497
|
select DISTINCT chance_id from audit_flow_process where uid =%v
|
499
|
select DISTINCT chance_id from audit_flow_process where uid =%v
|
498
|
) a inner join chance b on a.chance_id = b.id
|
500
|
) a inner join chance b on a.chance_id = b.id
|
499
|
|
501
|
|