| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace app\model;
- use think\Model;
- class GameImproveUserRtpModel extends Model
- {
- // 设置表名
- protected $name = 'improve_user_rtp_control';
- protected $connection = 'fortue_tiger';
- // 设置主键
- protected $pk = 'id';
- // 设置自动时间戳
- protected $autoWriteTimestamp = 'int';
- // 设置字段类型
- protected $type = [
- 'id' => 'int',
- 'app_id' => 'int', // 商户ID
- 'user_id' => 'int', // 用户ID
- 'player_id' => 'int', // 玩家ID
- // 'game_id' => 'string', // 游戏ID
- 'effective_count' => 'int', // 周期内可被系统控制的次数
- 'now_effective_count' => 'int', // 周期内已生效的次数
- 'evaluation_period' => 'int', // 系统控制的触发周期选择
- 'net_income' => 'int', // 设定玩家在游戏内盈利值达到后关闭功能
- 'trigger_interval_rounds' => 'int', // 每次系统控制间隔局数
- 'turnover_multiple' => 'int', // 达到设定流水倍数关闭提升状态
- 'old_rtp' => 'int', // 设置时当前RTP值,
- 'control_balance' => 'decimal', // 设置时点控那刻当前余额
- 'bet_amount' => 'int', // 点控期间 下注总分数
- 'bet_count' => 'int', // 点控期间 下单总数量
- 'total_win_amount' => 'int', // 点控期间总输赢
- 'winning_score' => 'int',
- 'custom_time_start' => 'int', // 周期自定义时间
- 'custom_time_end' => 'int', // 周期自定义时间
- 'status' => 'int', // 状态 1 正常,0 取消
- 'create_time' => 'int',
- 'update_time' => 'int',
- 'end_time' => 'int',
- ];
- /**
- * 获取点控详情
- * @param $merchantId
- * @param $uname
- * @param $game_id
- * @return mixed
- */
- public static function getImproveUserRtpInfo($wheres)
- {
- return self::where($wheres)->find();
- }
- /**
- * 根据商户ID获取玩家列表
- */
- public static function getImproveUserRtpList($merchantId, $page = 1, $limit = 10, $wheres = [])
- {
- $query = self::where($wheres);
- $order = $filters['order'] ?? 'create_time';
- $sort = $filters['sort'] ?? 'desc';
- $query->order($order, $sort);
- // 获取总数
- $total = $query->count();
- // 获取列表
- $list = $query->page($page, $limit)->select()->toArray();
- return [
- 'list' => $list,
- 'total' => $total,
- 'page' => $page,
- 'limit' => $limit
- ];
- }
- }
|