12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace app\admin\model\laboratory;
- use think\Model;
- /**
- * Introduction
- */
- class Introduction extends Model
- {
- // 表名
- protected $name = 'laboratory_introduction';
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = true;
- public function getLaboratorydisplayDiagramAttr($value): array
- {
- if ($value === '' || $value === null) return [];
- if (!is_array($value)) {
- return explode(',', $value);
- }
- return $value;
- }
- public function setLaboratorydisplayDiagramAttr($value): string
- {
- return is_array($value) ? implode(',', $value) : $value;
- }
- public function getLaboratoryIntroductionAttr($value): string
- {
- return !$value ? '' : htmlspecialchars_decode($value);
- }
- }
|