ahmedrahil786

DL Reject reason and members - Rahil

Aug 14th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. select distinct dl.member_id , dl.reject_category_id , dlc.name , Date(dl.created_at + interval 8 hour) as date
  2. from driver_licenses dl left join driver_license_reject_categories dlc on dlc.id = dl.reject_category_id
  3. where dl.state = 'reject'
  4. and dl.reject_category_id in ('10')
  5. and Date(dl.created_at + interval 8 hour) = date_sub(curdate() , interval 1 day)
  6. order by dl.member_id desc ;
  7.  
  8. # no of members by reject reason /* */
  9.  
  10. select
  11. date_format(date(dl.created_at + interval 8 hour), "%Y-%m-%d") as cday,
  12. count(dl.id) as total,
  13. count(if(rc.id=1, dl.id, null)) as sf_cov_bydoc,
  14. count(if(rc.id=2, dl.id, null)) as sf_wo_face,
  15. count(if(rc.id=3, dl.id, null)) as sf_wo_doc,
  16. count(if(rc.id=4, dl.id, null)) as dl_no_doc,
  17. count(if(rc.id=5, dl.id, null)) as dl_doc_blur,
  18. count(if(rc.id=6, dl.id, null)) as dl_expired,
  19. count(if(rc.id=7, dl.id, null)) as pdl,
  20. count(if(rc.id=8, dl.id, null)) as jpj_blacklist,
  21. count(if(rc.id=9, dl.id, null)) as dl_unmatched,
  22. count(if(rc.id=10, dl.id, null)) as pic_crop,
  23. count(if(rc.id=11, dl.id, null)) as unser_21,
  24. count(if(rc.id=12, dl.id, null)) as fake_id,
  25. count(if(rc.id=13, dl.id, null)) as etc,
  26. count(if(rc.id=14, dl.id, null)) as duplicate_IC,
  27. count(if(rc.id=15, dl.id, null)) as IC_in_selfie_blur,
  28. count(if(rc.id=16, dl.id, null)) as passport_blur,
  29. count(if(rc.id=17, dl.id, null)) as unrelated
  30.  
  31.  
  32. from members m, driver_licenses dl, driver_license_reject_categories rc
  33. where
  34. m.id = dl.member_id
  35. and m.imaginary in ('sofam', 'normal')
  36. and dl.state = 'reject'
  37. and dl.reject_category_id = rc.id
  38. group by cday
  39. order by cday desc
Advertisement
Add Comment
Please, Sign In to add comment