| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Models;
- use App\Services\ConfigService;
- use Illuminate\Support\Facades\Cache;
- class Config extends BaseModel
- {
- protected $table = 'config';
- protected $fillable = ['field', 'val', 'remark', 'group_id'];
- /*
- * group_id
- * 1 系统基础配置
- * 2 频道消息配置
- * 3 用户自定义配置
- * 4 极速PC28相关配置
- *
- *
- */
- public static function setPc28Switch()
- {
- $pc28_switch = Cache::get('pc28_switch');
- $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,isTop:true); // 异步群通知
- }
- }
- }
|