GameImproveRtpGlobalModel.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. 'open_status_time' => 'int',
  27. ];
  28. public static function initCreateGlobal($app_id) {
  29. self::create([
  30. 'app_id' => $app_id,
  31. 'status' => 1,
  32. 'effective_count' => 1,
  33. 'evaluation_period' => 4,
  34. 'net_income' => 100,
  35. 'trigger_interval_rounds' => 300,
  36. 'turnover_multiple' => 5,
  37. 'custom_time_start' => 0,
  38. 'custom_time_end' => 0,
  39. 'open_status_time' => time()
  40. ]);
  41. }
  42. public static function getInfo($app_id) {
  43. return self::find($app_id);
  44. }
  45. }