InnerDeviceNamesModel.php 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Models;
  3. use App\Models\BaseModel;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\SoftDeletes;
  6. /**
  7. * @description 内部设备名称
  8. * @author system;
  9. * @version 1.0
  10. * @date 2021-01-25 13:37:36
  11. *
  12. */
  13. class InnerDeviceNamesModel extends BaseModel
  14. {
  15. /**
  16. * 数据表名
  17. *
  18. * @var string
  19. *
  20. */
  21. use SoftDeletes;
  22. protected $table = 'inner_device_names';
  23. /**
  24. 主键
  25. */
  26. protected $primaryKey = 'id';
  27. //分页
  28. protected $perPage = PAGE_NUMS;
  29. /**
  30. * 可以被集体附值的表的字段
  31. *
  32. * @var string
  33. */
  34. protected $fillable = [
  35. 'name',
  36. 'sort',
  37. 'status'
  38. ];
  39. public static function getOptions(){
  40. return self::where('id', '>', 0)->orderBy('sort')->get()->toArray();
  41. }
  42. }