新增功能
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model\tcm;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
/**
|
||||
* 通话记录模型
|
||||
* Class CallRecord
|
||||
* @package app\common\model\tcm
|
||||
*/
|
||||
class CallRecord extends BaseModel
|
||||
{
|
||||
protected $name = 'tcm_call_record';
|
||||
|
||||
/**
|
||||
* @notes 关联诊单
|
||||
*/
|
||||
public function diagnosis()
|
||||
{
|
||||
return $this->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']] ?? '未知';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user