SsConfig.php 1.2 KB

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