Ken 1 天之前
父節點
當前提交
a826266298
共有 1 個文件被更改,包括 8 次插入5 次删除
  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);   // 异步群通知
+        }
     }
 }