Guest User

Untitled

a guest
Jan 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2. {#"%.2f"|sprintf:($item['prize']*0.03 + 128)#}
  3. $the_god_of_wealth = array();
  4. foreach ($order_by_month_rs['month']['data'] as $v)
  5. {
  6. if($v['prize'] > 10000) {
  7. $the_god_of_wealth[] = array($v['uid'], $v['namemask'], $v['prize']);
  8. }
  9. }
  10. //财神个数
  11. $uids = array();
  12. foreach ($the_god_of_wealth as $k => $v)
  13. {
  14. $uids[] = $v[1];
  15. }
  16. $idarr = array();
  17. foreach ($uids as $id)
  18. {
  19. $idcounts = 0;
  20. foreach ($uids as $ids)
  21. {
  22. if($id === $ids)
  23. {
  24. $idcounts +=1;
  25. }
  26. }
  27. $idarr[$id] = $idcounts;
  28. }
  29.  
  30. $tmp = array_unique($idarr);
  31. $id_last = array();
  32. foreach ($idarr as $k => $v)
  33. {
  34. if (!isset($tmp[$k])) {
  35. $id_last[$k] = $v;
  36. }
  37. }
  38. $id_front = array_flip($tmp);
  39. krsort($id_front);
  40. # 查询月排行;
  41. $this->output = array(
  42. 'wealthest' => $the_god_of_wealth,
  43. 'wealthest_again' => array('front' => $id_front,'last' => $id_last),
  44. 'month' => 9,
  45. 'order_by_month' => $order_by_month_rs['month']
  46. );
Add Comment
Please, Sign In to add comment