作者 yangfu

机会池排序修改

@@ -315,7 +315,7 @@ select * from ( @@ -315,7 +315,7 @@ select * from (
315 315
316 ##我审核 316 ##我审核
317 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 ( 317 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 (
318 - select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3 318 + select DISTINCT chance_id from audit_flow_process where uid =%v
319 ) a inner join chance b on a.chance_id = b.id 319 ) a inner join chance b on a.chance_id = b.id
320 320
321 ) 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 321 ) 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 @@ -328,17 +328,17 @@ limit %v
328 select count(0) from ( 328 select count(0) from (
329 ##公司公开的机会 329 ##公司公开的机会
330 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 330 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
331 - where company_id = %v and publish_status = 2 331 + where company_id = %v and publish_status = 2 and review_status=3
332 UNION 332 UNION
333 333
334 ##指定部门-机会提交的部门 334 ##指定部门-机会提交的部门
335 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 335 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
336 - where department_id in (%v) 336 + where department_id in (%v) and review_status=3
337 UNION 337 UNION
338 338
339 ##本人 339 ##本人
340 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 340 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
341 - where user_id = %v 341 + where user_id = %v and review_status=3
342 UNION 342 UNION
343 343
344 ##我审核 344 ##我审核
@@ -390,7 +390,7 @@ select * from ( @@ -390,7 +390,7 @@ select * from (
390 390
391 ##我审核 391 ##我审核
392 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 ( 392 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 (
393 - select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3 393 + select DISTINCT chance_id from audit_flow_process where uid =%v
394 ) a inner join chance b on a.chance_id = b.id 394 ) a inner join chance b on a.chance_id = b.id
395 395
396 ) 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 396 ) 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 ( @@ -426,7 +426,7 @@ select count(0) from (
426 426
427 ##我审核 427 ##我审核
428 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 ( 428 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 (
429 - select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3 429 + select DISTINCT chance_id from audit_flow_process where uid =%v
430 ) a inner join chance b on a.chance_id = b.id 430 ) a inner join chance b on a.chance_id = b.id
431 431
432 ) a where review_status=3 and (0=%v or chance_type_id =%v) and a.enable_status=1 and status=1 432 ) 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 ( @@ -467,7 +467,7 @@ select * from (
467 467
468 ##我审核 468 ##我审核
469 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 ( 469 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 (
470 - select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3 470 + select DISTINCT chance_id from audit_flow_process where uid =%v
471 ) a inner join chance b on a.chance_id = b.id 471 ) a inner join chance b on a.chance_id = b.id
472 472
473 ) 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 473 ) 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 @@ -480,18 +480,20 @@ limit %v
480 select count(0) from ( 480 select count(0) from (
481 ##公司公开的机会 481 ##公司公开的机会
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 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
483 - where company_id = %v and publish_status = 2 483 + where company_id = %v and publish_status = 2 and review_status=3
484 484
485 UNION 485 UNION
486 ##指定部门-机会公开的部门 486 ##指定部门-机会公开的部门
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 ( 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 (
488 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)
489 )a inner join chance b on a.chance_id = b.id 489 )a inner join chance b on a.chance_id = b.id
  490 + where review_status=3
  491 +
490 UNION 492 UNION
491 493
492 ##本人 494 ##本人
493 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 495 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
494 - where user_id = %v 496 + where user_id = %v and review_status=3
495 UNION 497 UNION
496 498
497 ##我审核 499 ##我审核
@@ -524,7 +526,7 @@ select * from ( @@ -524,7 +526,7 @@ select * from (
524 526
525 ##我审核 527 ##我审核
526 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 ( 528 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 (
527 - select DISTINCT chance_id from audit_flow_process where uid =%v and review_status=3 529 + select DISTINCT chance_id from audit_flow_process where uid =%v
528 ) a inner join chance b on a.chance_id = b.id 530 ) a inner join chance b on a.chance_id = b.id
529 531
530 ) 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 532 ) 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 @@ -537,7 +539,7 @@ limit %v
537 select count(0) from ( 539 select count(0) from (
538 ##本人 540 ##本人
539 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 541 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
540 - where user_id = %v 542 + where user_id = %v and review_status=3
541 UNION 543 UNION
542 544
543 ##我审核 545 ##我审核