ExamSubjectsModel.php 656 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class ExamSubjectsModel extends BaseModel
  5. {
  6. protected $table = 'exam_subjects';
  7. public $timestamps = false;
  8. protected $fillable = [
  9. 'subject_name',
  10. 'pid',
  11. 'type',
  12. 'attr_type',
  13. 'description',
  14. 'icon',
  15. 'sort',
  16. 'create_time',
  17. 'update_time',
  18. 'status',
  19. 'mark'
  20. ];
  21. public function getIconAttribute($value)
  22. {
  23. return $value ? get_image_url($value) : '';
  24. }
  25. public function setIconAttribute($value)
  26. {
  27. return $value ? get_image_path($value) : '';
  28. }
  29. }