DocumentImages.php 771 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class DocumentImages extends Model
  5. {
  6. protected $table = "jm_document_images";
  7. public function getFullTextUrlAttr($value)
  8. {
  9. if($value) {
  10. $value = json_decode($value);
  11. return $value[0];
  12. }
  13. return $value;
  14. }
  15. /**
  16. * 图像类型
  17. */
  18. public static function imageType($type = '')
  19. {
  20. $types = [
  21. 'x' => 'X线片',
  22. 'ct' => 'CT',
  23. 'mri' => 'MRI',
  24. 'pet' => 'PET',
  25. 'ultrasound' => '超声图像',
  26. 'microscopy' => '显微镜图',
  27. 'graphics' => '绘图图表',
  28. ];
  29. return $type ? $types[$type] : $types;
  30. }
  31. }