SsConfig.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. protected $primaryKey = 'id';
  29. // 筛选默认
  30. function scopeDefault($query) {
  31. $query->whereIsDefault(1);
  32. }
  33. // 筛选类型
  34. function scopeType($query, $type) {
  35. $query->whereType($type);
  36. }
  37. }