<?php
namespace app\model;

use think\Model;


class DocumentImages extends Model
{
    protected $table = "jm_document_images";



    public function getFullTextUrlAttr($value)
    {
        if($value) {
            $value = json_decode($value);
            return $value[0];
        }
        return $value;
    }


    /**
     * 图像类型
     */
    public static function imageType($type = '')
    {
        $types = [
            'x'          => 'X线片',
            'ct'         => 'CT',
            'mri'        => 'MRI',
            'pet'        => 'PET',
            'ultrasound' => '超声图像',
            'microscopy' => '显微镜图',
            'graphics'   => '绘图图表',
        ];
        return $type ? $types[$type] : $types;
    }

}
