ConfigServer.php 758 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Servers;
  3. use App\Models\Config;
  4. class ConfigServer
  5. {
  6. // 今日MUC价格
  7. static public function mucDay()
  8. {
  9. $muc = Config::where('key', 'muc')->first()->{'value'};
  10. $mucDay = sprintf('%.2f', ($muc + (mt_rand(0,15) * $muc / 1000)));
  11. Config::where('key', 'day_muc')->update(['value' => $mucDay]);
  12. Config::where('key', 'muc')->update(['value' => $mucDay]);
  13. }
  14. // 静态收益千分币(33 / 10000) - (50 / 10000)
  15. static public function jtDay()
  16. {
  17. $start = config('muc.day_jt_radio_start', '33');
  18. $end = config('muc.day_jt_radio_end', '50');
  19. $radio = mt_rand($start, $end);
  20. Config::where('key', 'day_jt_radio')->update(['value' => $radio]);
  21. }
  22. }