ExamSubjectsModel.php 680 B

123456789101112131415161718192021222324252627282930313233343536
  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. 'answer_times',
  16. 'sort',
  17. 'create_time',
  18. 'update_time',
  19. 'status',
  20. 'mark'
  21. ];
  22. public function getIconAttribute($value)
  23. {
  24. return $value ? get_image_url($value) : '';
  25. }
  26. public function setIconAttribute($value)
  27. {
  28. return $value ? get_image_path($value) : '';
  29. }
  30. }