belongsTo('app\common\model\tcm\Diagnosis', 'diagnosis_id', 'id'); } /** * @notes 获取通话类型文本 */ public function getCallTypeTextAttr($value, $data) { $types = [ 1 => '语音通话', 2 => '视频通话' ]; return $types[$data['call_type']] ?? '未知'; } /** * @notes 获取状态文本 */ public function getStatusTextAttr($value, $data) { $status = [ 1 => '进行中', 2 => '已结束', 3 => '未接听', 4 => '已取消' ]; return $status[$data['status']] ?? '未知'; } }