GameImproveUserRtpModel.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. 'open_status_time' => 'int', // 每轮开始的时间
  37. 'create_time' => 'int',
  38. 'update_time' => 'int',
  39. 'end_time' => 'int',
  40. ];
  41. /**
  42. * 获取点控详情
  43. * @param $merchantId
  44. * @param $uname
  45. * @param $game_id
  46. * @return mixed
  47. */
  48. public static function getImproveUserRtpInfo($wheres)
  49. {
  50. return self::where($wheres)->find();
  51. }
  52. /**
  53. * 根据商户ID获取玩家列表
  54. */
  55. public static function getImproveUserRtpList($merchantId, $page = 1, $limit = 10, $wheres = [])
  56. {
  57. $query = self::where($wheres);
  58. $order = $filters['order'] ?? 'create_time';
  59. $sort = $filters['sort'] ?? 'desc';
  60. $query->order($order, $sort);
  61. // 获取总数
  62. $total = $query->count();
  63. // 获取列表
  64. $list = $query->page($page, $limit)->select()->toArray();
  65. return [
  66. 'list' => $list,
  67. 'total' => $total,
  68. 'page' => $page,
  69. 'limit' => $limit
  70. ];
  71. }
  72. }