GameImproveRtpGlobalModel.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class GameImproveRtpGlobalModel extends Model
  5. {
  6. // 设置表名
  7. protected $name = 'improve_rtp_global_control';
  8. // 设置主键
  9. protected $pk = 'app_id';
  10. protected $connection = 'fortue_tiger';
  11. // 设置自动时间戳
  12. protected $autoWriteTimestamp = 'int';
  13. // 设置字段类型
  14. protected $type = [
  15. 'app_id' => 'int', // 商户ID
  16. 'effective_count' => 'int', // 周期内可被系统控制的次数
  17. 'evaluation_period' => 'int', // 系统控制的触发周期选择
  18. 'net_income' => 'int', // 设定玩家在游戏内盈利值达到后关闭功能
  19. 'trigger_interval_rounds' => 'int', // 每次系统控制间隔局数
  20. 'turnover_multiple' => 'int', // 达到设定流水倍数关闭提升状态
  21. 'custom_time_start' => 'int', // 周期自定义时间
  22. 'custom_time_end' => 'int', // 周期自定义时间
  23. 'status' => 'int', // 状态 1 正常,0 取消
  24. 'create_time' => 'int',
  25. 'update_time' => 'int',
  26. ];
  27. public static function initCreateGlobal($app_id) {
  28. self::create([
  29. 'app_id' => $app_id,
  30. 'status' => 1,
  31. 'effective_count' => 1,
  32. 'evaluation_period' => 4,
  33. 'net_income' => 100,
  34. 'trigger_interval_rounds' => 300,
  35. 'turnover_multiple' => 5,
  36. 'custom_time_start' => 0,
  37. 'custom_time_end' => 0,
  38. ]);
  39. }
  40. public static function getInfo($app_id) {
  41. return self::find($app_id);
  42. }
  43. }