|
@@ -266,6 +266,10 @@ func GetChancePoolSpecialDepartment(uid, cid int64, chanceTypeId int, lastId int |
|
@@ -266,6 +266,10 @@ func GetChancePoolSpecialDepartment(uid, cid int64, chanceTypeId int, lastId int |
266
|
sql := fmt.Sprintf(`
|
266
|
sql := fmt.Sprintf(`
|
267
|
select a.*,b.images,speechs,videos from (
|
267
|
select a.*,b.images,speechs,videos from (
|
268
|
select * from (
|
268
|
select * from (
|
|
|
269
|
+ ##公司公开的机会
|
|
|
270
|
+ 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
|
|
|
271
|
+ where company_id = %v and publish_status = 2
|
|
|
272
|
+
|
269
|
##指定部门-机会提交的部门
|
273
|
##指定部门-机会提交的部门
|
270
|
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
|
274
|
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
|
271
|
where department_id in (%v)
|
275
|
where department_id in (%v)
|
|
@@ -285,10 +289,14 @@ select * from ( |
|
@@ -285,10 +289,14 @@ select * from ( |
285
|
order by create_at desc
|
289
|
order by create_at desc
|
286
|
limit %v
|
290
|
limit %v
|
287
|
) a left JOIN chance_data b on a.id =b.chance_id
|
291
|
) a left JOIN chance_data b on a.id =b.chance_id
|
288
|
-`, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId, lastId, lastId, pageSize)
|
292
|
+`, cid, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId, lastId, lastId, pageSize)
|
289
|
|
293
|
|
290
|
sqlCount := fmt.Sprintf(`
|
294
|
sqlCount := fmt.Sprintf(`
|
291
|
select count(0) from (
|
295
|
select count(0) from (
|
|
|
296
|
+ ##公司公开的机会
|
|
|
297
|
+ 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
|
|
|
298
|
+ where company_id = %v and publish_status = 2
|
|
|
299
|
+
|
292
|
##指定部门-机会提交的部门
|
300
|
##指定部门-机会提交的部门
|
293
|
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
|
301
|
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
|
294
|
where department_id in (%v)
|
302
|
where department_id in (%v)
|
|
@@ -305,7 +313,7 @@ select count(0) from ( |
|
@@ -305,7 +313,7 @@ select count(0) from ( |
305
|
) a inner join chance b on a.chance_id = b.id
|
313
|
) a inner join chance b on a.chance_id = b.id
|
306
|
|
314
|
|
307
|
) a where review_status=3 and (0=%v or chance_type_id =%v) and a.enable_status=1
|
315
|
) a where review_status=3 and (0=%v or chance_type_id =%v) and a.enable_status=1
|
308
|
-`, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId)
|
316
|
+`, cid, utils.JoinInt64s(departmentIds, ","), uid, uid, chanceTypeId, chanceTypeId)
|
309
|
if err = utils.ExecuteQueryOne(&total, sqlCount); err != nil {
|
317
|
if err = utils.ExecuteQueryOne(&total, sqlCount); err != nil {
|
310
|
return
|
318
|
return
|
311
|
}
|
319
|
}
|