LibraryTask.php 690 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. use Illuminate\Database\Eloquent\Model;
  6. class LibraryTask extends Model
  7. {
  8. use HasDateTimeFormatter;
  9. use SoftDeletes;
  10. protected $table = 'library_tasks';
  11. protected $guarded = [];
  12. const STATUS_WAIT = 1;
  13. const STATUS_IN = 2;
  14. const STATUS_SUCCESS = 3;
  15. const STATUS_FAIL = 4;
  16. const statusMaps = [
  17. 1 => '待导入',
  18. 2 => '正在导入',
  19. 3 => '导入成功',
  20. 4 => '读取失败',
  21. ];
  22. public function category()
  23. {
  24. return $this->belongsTo(LibraryCategory::class, 'category_id');
  25. }
  26. }