GameImproveUserRtpModel.php 2.7 KB

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