GameImproveUserRtpModel.php 2.5 KB

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