GameImproveUserRtpModel.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. 'evaluation_period' => 'int', // 系统控制的触发周期选择
  23. 'net_income' => 'int', // 设定玩家在游戏内盈利值达到后关闭功能
  24. 'trigger_interval_rounds' => 'int', // 每次系统控制间隔局数
  25. 'turnover_multiple' => 'int', // 达到设定流水倍数关闭提升状态
  26. 'old_rtp' => 'int', // 设置时当前RTP值,
  27. 'control_balance' => 'decimal', // 设置时点控那刻当前余额
  28. 'bet_amount' => 'int', // 点控期间 下注总分数
  29. 'bet_count' => 'int', // 点控期间 下单总数量
  30. 'total_win_amount' => 'int', // 点控期间总输赢
  31. 'winning_score' => 'int',
  32. 'custom_time_start' => 'int', // 周期自定义时间
  33. 'custom_time_end' => 'int', // 周期自定义时间
  34. 'status' => 'int', // 状态 1 正常,0 取消
  35. 'round_status' => 'int', // 轮开始 1 开始, 2 已满足
  36. 'create_time' => 'int',
  37. 'update_time' => 'int',
  38. 'end_time' => 'int',
  39. ];
  40. /**
  41. * 获取点控详情
  42. * @param $merchantId
  43. * @param $uname
  44. * @param $game_id
  45. * @return mixed
  46. */
  47. public static function getImproveUserRtpInfo($wheres)
  48. {
  49. return self::where($wheres)->find();
  50. }
  51. /**
  52. * 根据商户ID获取玩家列表
  53. */
  54. public static function getImproveUserRtpList($merchantId, $page = 1, $limit = 10, $wheres = [])
  55. {
  56. $query = self::where($wheres);
  57. $order = $filters['order'] ?? 'create_time';
  58. $sort = $filters['sort'] ?? 'desc';
  59. $query->order($order, $sort);
  60. // 获取总数
  61. $total = $query->count();
  62. // 获取列表
  63. $list = $query->page($page, $limit)->select()->toArray();
  64. return [
  65. 'list' => $list,
  66. 'total' => $total,
  67. 'page' => $page,
  68. 'limit' => $limit
  69. ];
  70. }
  71. }