Ken 1 päivä sitten
vanhempi
commit
a826266298
1 muutettua tiedostoa jossa 8 lisäystä ja 5 poistoa
  1. 8 5
      app/Models/Config.php

+ 8 - 5
app/Models/Config.php

@@ -23,10 +23,13 @@ class Config extends BaseModel
     public static function setPc28Switch()
     {
         $pc28_switch = Cache::get('pc28_switch');
-        if ($pc28_switch == null) $pc28_switch = static::where('field', 'pc28_switch')->first()->val;
-        static::where('field', 'pc28_switch')->update(['val' => $pc28_switch]);
-        $groupText = "------已切换为极速PC28------";
-        if ($pc28_switch == 0) $groupText = "-----已切换为加拿大PC28------";
-        ConfigService::asyncBettingGroupNotice($groupText);   // 异步群通知
+        $val = static::where('field', 'pc28_switch')->first()->val;
+        if ($pc28_switch == null) $pc28_switch = $val;
+        if ($pc28_switch != $val) {
+            static::where('field', 'pc28_switch')->update(['val' => $pc28_switch]);
+            $groupText = "------已切换为极速PC28------";
+            if ($pc28_switch == 0) $groupText = "-----已切换为加拿大PC28------";
+            ConfigService::asyncBettingGroupNotice($groupText);   // 异步群通知
+        }
     }
 }