GameImproveUserRtpModel.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class GameImproveUserRtpModel extends Model
  5. {
  6. // 设置表名
  7. protected $name = 'improve_user_rtp_control';
  8. protected $connection = 'fortue_tiger';
  9. // 设置主键
  10. protected $pk = 'id';
  11. // 设置自动时间戳
  12. protected $autoWriteTimestamp = 'int';
  13. // 设置字段类型
  14. protected $type = [
  15. 'id' => 'int',
  16. 'app_id' => 'int', // 商户ID
  17. 'user_id' => 'int', // 用户ID
  18. 'player_id' => 'int', // 玩家ID
  19. // 'game_id' => 'string', // 游戏ID
  20. 'effective_count' => 'int', // 周期内可被系统控制的次数
  21. 'now_effective_count' => 'int', // 周期内已生效的次数
  22. 'now_total_effective_count' => 'int', // 周期内已生效的总次数
  23. 'evaluation_period' => 'int', // 系统控制的触发周期选择
  24. 'net_income' => 'int', // 设定玩家在游戏内盈利值达到后关闭功能
  25. 'trigger_interval_rounds' => 'int', // 每次系统控制间隔局数
  26. 'turnover_multiple' => 'int', // 达到设定流水倍数关闭提升状态
  27. 'old_rtp' => 'int', // 设置时当前RTP值,
  28. 'control_balance' => 'decimal', // 设置时点控那刻当前余额
  29. 'bet_amount' => 'int', // 点控期间 下注总分数
  30. 'bet_count' => 'int', // 点控期间 下单总数量
  31. 'total_win_amount' => 'int', // 点控期间总输赢
  32. 'winning_score' => 'int',
  33. 'custom_time_start' => 'int', // 周期自定义时间
  34. 'custom_time_end' => 'int', // 周期自定义时间
  35. 'status' => 'int', // 状态 1 正常,0 取消
  36. 'round_status' => 'int', // 轮开始 1 开始, 2 已满足
  37. 'round_count' => 'int',
  38. 'open_status_time' => 'int', // 每轮开始的时间
  39. 'create_time' => 'int',
  40. 'update_time' => 'int',
  41. 'end_time' => 'int',
  42. ];
  43. /**
  44. * 获取点控详情
  45. * @param $merchantId
  46. * @param $uname
  47. * @param $game_id
  48. * @return mixed
  49. */
  50. public static function getImproveUserRtpInfo($wheres)
  51. {
  52. return self::where($wheres)->find();
  53. }
  54. /**
  55. * 根据商户ID获取玩家列表
  56. */
  57. public static function getImproveUserRtpList($merchantId, $page = 1, $limit = 10, $wheres = [])
  58. {
  59. $query = self::where($wheres);
  60. $order = $filters['order'] ?? 'create_time';
  61. $sort = $filters['sort'] ?? 'desc';
  62. $query->order($order, $sort);
  63. // 获取总数
  64. $total = $query->count();
  65. // 获取列表
  66. $list = $query->page($page, $limit)->select()->toArray();
  67. return [
  68. 'list' => $list,
  69. 'total' => $total,
  70. 'page' => $page,
  71. 'limit' => $limit
  72. ];
  73. }
  74. }