SsConfig.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 配置信息
  7. *
  8. * @property int $id
  9. * @property string $name 配置名
  10. * @property int $type 类型:1-加密方式、2-协议、3-混淆
  11. * @property int $is_default 是否默认:0-不是、1-是
  12. * @property int $sort 排序:值越大排越前
  13. * @method static Builder|SsConfig default()
  14. * @method static Builder|SsConfig newModelQuery()
  15. * @method static Builder|SsConfig newQuery()
  16. * @method static Builder|SsConfig query()
  17. * @method static Builder|SsConfig type($type)
  18. * @method static Builder|SsConfig whereId($value)
  19. * @method static Builder|SsConfig whereIsDefault($value)
  20. * @method static Builder|SsConfig whereName($value)
  21. * @method static Builder|SsConfig whereSort($value)
  22. * @method static Builder|SsConfig whereType($value)
  23. * @mixin \Eloquent
  24. */
  25. class SsConfig extends Model {
  26. public $timestamps = false;
  27. protected $table = 'ss_config';
  28. // 筛选默认
  29. public function scopeDefault($query): void {
  30. $query->whereIsDefault(1);
  31. }
  32. // 筛选类型
  33. public function scopeType($query, $type): void {
  34. $query->whereType($type);
  35. }
  36. }