海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
511 B

4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. use Illuminate\Database\Eloquent\Model;
  6. class SystemSetting extends Model
  7. {
  8. use HasDateTimeFormatter;
  9. use SoftDeletes;
  10. protected $table = 'system_settings';
  11. protected $guarded = ['id'];
  12. protected $casts = ['value' => 'json'];
  13. public static function val($key,$value)
  14. {
  15. $setting = static::query()->where('key',$key)->value('value');
  16. return $setting[$value] ?? null;
  17. }
  18. }