BuyQuery.php 985 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace Biz\Record;
  3. /**
  4. * 购彩记录
  5. */
  6. class BuyQuery {
  7. private $game_type = 'game_type';
  8. /**
  9. * 资金记录表
  10. * @var string
  11. */
  12. private $fund_detailed = 'fund_detailed';
  13. /**
  14. * 游戏记录表
  15. * @var string
  16. */
  17. private $game_table = 'game_type';
  18. public function getList($account_identity) {
  19. //获取投注记录
  20. $res = lm($this->fund_detailed, 'Commons')
  21. ->where('account_identity', $account_identity)
  22. ->where('money_type', 1)
  23. ->orWhere('money_type', 2)
  24. ->get()
  25. ->toArray();
  26. //获取游戏名
  27. if (is_array($res)) {
  28. foreach ($res as $k => $v) {
  29. $res['name'] = $this->getGameName($v['game_type']);
  30. }
  31. }
  32. return $res;
  33. }
  34. /**
  35. * 通过游戏id获取游戏名字
  36. * @param [int] $gmae_id 游戏id
  37. * @return [type] [descr5
  38. * iption]
  39. */
  40. public function getGameName($game_id) {
  41. $res = lm($this->game_type, 'Commons')->where('identity', $game_id)->first()->name;
  42. return $res;
  43. }
  44. }
  45. ?>