SsConfig.php 1.3 KB

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