|
@@ -170,16 +170,15 @@ where user_id=? and company_id=? and review_status in (%v) and status=1 and enab |
|
@@ -170,16 +170,15 @@ where user_id=? and company_id=? and review_status in (%v) and status=1 and enab |
170
|
return
|
170
|
return
|
171
|
}
|
171
|
}
|
172
|
|
172
|
|
173
|
-func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
173
|
+func GetChanceMyApproveChance(uid, cid int64, reviewStatus []int8, offset int, pageSize int, v interface{}) (total int, err error) {
|
174
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
174
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
175
|
select a.*,b.user_id chance_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 (
|
175
|
select a.*,b.user_id chance_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 (
|
176
|
select id,approve_time,approve_data,uid,chance_id,approve_message,update_at process_create_time
|
176
|
select id,approve_time,approve_data,uid,chance_id,approve_message,update_at process_create_time
|
177
|
from audit_flow_process where uid=? and review_status in (%v)
|
177
|
from audit_flow_process where uid=? and review_status in (%v)
|
178
|
)a left outer join chance b on a.chance_id = b.id
|
178
|
)a left outer join chance b on a.chance_id = b.id
|
179
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
179
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
180
|
-where (?=0 or unix_timestamp(a.update_at)<?)
|
|
|
181
|
-order by a.update_at desc
|
|
|
182
|
-LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //备注:and enable_status =1 //就算已经删除了,列表上面还是要体现已经删除
|
180
|
+order by a.approve_time desc
|
|
|
181
|
+LIMIT ?,?`, utils.JoinInt8s(reviewStatus, ",")) //备注:and enable_status =1 //就算已经删除了,列表上面还是要体现已经删除
|
183
|
|
182
|
|
184
|
sqlCount := fmt.Sprintf(`select count(0)
|
183
|
sqlCount := fmt.Sprintf(`select count(0)
|
185
|
from audit_flow_process where uid=? and review_status in (%v) `, utils.JoinInt8s(reviewStatus, ",")) //and enable_status =1
|
184
|
from audit_flow_process where uid=? and review_status in (%v) `, utils.JoinInt8s(reviewStatus, ",")) //and enable_status =1
|
|
@@ -187,7 +186,7 @@ from audit_flow_process where uid=? and review_status in (%v) `, utils.JoinInt8 |
|
@@ -187,7 +186,7 @@ from audit_flow_process where uid=? and review_status in (%v) `, utils.JoinInt8 |
187
|
return
|
186
|
return
|
188
|
}
|
187
|
}
|
189
|
if v != nil {
|
188
|
if v != nil {
|
190
|
- if err = utils.ExecuteQueryAll(v, sql, uid, lastId, lastId, pageSize); err != nil {
|
189
|
+ if err = utils.ExecuteQueryAll(v, sql, uid, offset, pageSize); err != nil {
|
191
|
return
|
190
|
return
|
192
|
}
|
191
|
}
|
193
|
}
|
192
|
}
|
|
@@ -195,16 +194,15 @@ from audit_flow_process where uid=? and review_status in (%v) `, utils.JoinInt8 |
|
@@ -195,16 +194,15 @@ from audit_flow_process where uid=? and review_status in (%v) `, utils.JoinInt8 |
195
|
}
|
194
|
}
|
196
|
|
195
|
|
197
|
//获取有效的机会
|
196
|
//获取有效的机会
|
198
|
-func GetChanceMyApproveChanceEnable(uid, cid int64, reviewStatus []int8, lastId int64, pageSize int, v interface{}) (total int, err error) {
|
197
|
+func GetChanceMyApproveChanceEnable(uid, cid int64, reviewStatus []int8, offset int, pageSize int, v interface{}) (total int, err error) {
|
199
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
198
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos from (
|
200
|
select a.*,b.user_id chance_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,b.self_checks from (
|
199
|
select a.*,b.user_id chance_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,b.self_checks from (
|
201
|
select id,approve_time,approve_data,uid,chance_id,approve_message
|
200
|
select id,approve_time,approve_data,uid,chance_id,approve_message
|
202
|
from audit_flow_process where uid=? and review_status in (%v) and enable_status =1
|
201
|
from audit_flow_process where uid=? and review_status in (%v) and enable_status =1
|
203
|
)a left outer join chance b on a.chance_id = b.id
|
202
|
)a left outer join chance b on a.chance_id = b.id
|
204
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
203
|
)a left outer join chance_data b on a.chance_id =b.chance_id
|
205
|
-where (?=0 or unix_timestamp(a.update_at)<?)
|
|
|
206
|
order by a.update_at desc
|
204
|
order by a.update_at desc
|
207
|
-LIMIT ?`, utils.JoinInt8s(reviewStatus, ",")) //,update_at process_create_time
|
205
|
+LIMIT ?,?`, utils.JoinInt8s(reviewStatus, ",")) //,update_at process_create_time
|
208
|
|
206
|
|
209
|
sqlCount := fmt.Sprintf(`select count(0)
|
207
|
sqlCount := fmt.Sprintf(`select count(0)
|
210
|
from audit_flow_process where uid=? and review_status in (%v) and enable_status =1`, utils.JoinInt8s(reviewStatus, ",")) //and enable_status =1
|
208
|
from audit_flow_process where uid=? and review_status in (%v) and enable_status =1`, utils.JoinInt8s(reviewStatus, ",")) //and enable_status =1
|
|
@@ -212,7 +210,7 @@ from audit_flow_process where uid=? and review_status in (%v) and enable_status |
|
@@ -212,7 +210,7 @@ from audit_flow_process where uid=? and review_status in (%v) and enable_status |
212
|
return
|
210
|
return
|
213
|
}
|
211
|
}
|
214
|
if v != nil {
|
212
|
if v != nil {
|
215
|
- if err = utils.ExecuteQueryAll(v, sql, uid, lastId, lastId, pageSize); err != nil {
|
213
|
+ if err = utils.ExecuteQueryAll(v, sql, uid, offset, pageSize); err != nil {
|
216
|
return
|
214
|
return
|
217
|
}
|
215
|
}
|
218
|
}
|
216
|
}
|